我有一个div,我想将一段代码添加到onclick中。问题是代码不起作用。我认为这事做的onclick和我使用“/”使用jquery将链接附加到div
这里是jQuery的注释掉的尝试:
$("#content_type_nav").html("<a id='add_content_container' onClick=/"window.location.href='create.php';/"><img id='add_content_icon' src='Site_Images/add_column.PNG'/></a>");
下面是HTML:
<div data-role="footer" id="content_type_nav" data-position="fixed">
//I want the link to be inserted here
<h1>Show me my...</h1>
</div>
和你遇到的问题是......? – j08691
而且你不应该使用内联“onclick”...... –
链接不会出现在点击中。上面的代码是否正确?我想用/附近的“? –