如何使以下代码有效?感谢
<span onclick="showim('<h1>Test Head 1</h1><h2>Test Head 2</h2>');">Test</span>
<div id="divcont"></div>
$(document).ready(function () {
window.showim = function(src) {
$("divcont").html(src);
};
});
答案 0 :(得分:2)
$(document).ready(function () {
window.showim = function(src) {
$("#divcont").html(src);
};
});