jquery里面怎么alert

jquery里面怎么alert,第1张

引入了jQuery.js之后在<script></script>里面的任何位置都可以直接alert() 看你需要怎么使用了

给个例子 获取div的高度

<body>

<div id="myDiv" >这是一个div</div>

<script>

alert("123")

$(function(){

alert("123")

$("#myDiv").click(function(){

var height = $("#myDiv").height()

alert(height)

})

})

</script>

<style>

#myDiv{

width: 100px

height: 100px

border: solid 1px black

}

</style>

</body>

你好!

这句话:initialState:

"expanded",后面的逗号删掉

另外你把ie的安全级别再设低点看看,其次ie运行时要允许脚本运行才行,再试试吧

打字不易,采纳哦!


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/bake/11218910.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-14
下一篇 2023-05-14

发表评论

登录后才能评论

评论列表(0条)

保存