我有一些简单的HTML代码和一些javascript,它看起来像:
<html>
<head>
<script type="text/javascript">
function changeDivContent() { // ...
};
</script>
</head>
<body>
<input type="radio" name="radiobutton" value="A" onClick="changeDivContent()">
<input type="radio" name="radiobutton" value="B" onClick="changeDivContent()">
<div id="content"></div>
</body>
</html>
我只是希望能够通过选择"A“或"B”单选按钮来更改div的内容(它是内部的html),但是div#content没有javascript属性"value",所以我想知道如何才能做到这一点。
https://stackoverflow.com/questions/2554149
复制相似问题