You can simply use the below function, You can also change the type element. $("input[type=hidden]").bind("change", function() { alert($(this).val()); }); Changes in value to hidden elements don't automatically fire the .change() event
这是一个来自stackoverflow的问答,三哥直接把最佳回答搬过来了. 都说AngularJS的学习曲线异常诡异~~~ Q: “Thinking in AngularJS” if I have a jQuery background? A: 1. Don't design your page, and then change it with DOMmanipulations In jQuery, you design a page, and then you make it dynamic.
You might not need jQuery You certainly can support IE 9 and below without jQuery, but we don't. Please stop messing with us. jQuery and its cousins are great, and by all means use them if it makes it easier to develop your application. If you're dev
一.jquery中text val html attr的使用区别 html和innerHTMl是一样的,可以获得和设置指定元素如<p>中的html标签和文本如:设置值: $("p").html("<span style='font-size:13px;color:red'>HTML标签+文本</span>"); 获得值: $("p").html(); text和innerText是一样的,可以获得和设置文本如: