您好,我需要在 test.html 中创建一个表单,单击该表单会使用输入元素更改索引元素(标题、图像、描述(文本)和 href 属性)。你能帮助我吗?
索引.html
<html>
<body>
<p id="pal">This is a paragraph.</p>
<p>This is another paragraph.</p>
<button id="ch">Replace the first p element with new text</button>
</body>
</html>
测试.html
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("#ch").click(function(){
$("#pal").replaceWith(#in1);
});
});
</script>
</head>
<body>
<input id="in1" type="text"></input>
<input id="in2" type="text"></input>
</body>
</html>