<script type="text/javascript" src="/jq.js"></script>
<style type="text/css">
#box {width:200px;height:200px;background:#9999CC; border:solid 1px #990099;color:#FFFFFF}
</style>
<script type="text/javascript">
$(function(){ $("$cc").click(function(){
var $str="你好";
$("#box").append($str);
}
)
})
</script>
<div id="box">呵呵.</div>
<input type="button" name="c" id="cc" value=" click " />
怎么出错了呢?帮忙看看呀。
var $str="你好";
$("#box").append($str);
}
)
})
错在$("$cc")这了
$("#cc")
var $str="你好";
$("#box").append($str);
}
)
改为:
$("input[name=c]").click(function(){
var $str="你好";
$("#box").append($str);
}
)