一 attr () 和 prop( ) 操作属性 谈谈我的总结: 1 2 1 属性的定义,根据W3C手册所述:属性包括,标准属性:id class style title 语言属性 lang dir以及某些特定的元素的固有的属性,比如 a 的 href target 属性,input元素的 radio checked type alt src disabled value 等 ,img标签的width height src alt 等,不存在的属性叫做新增属性. 2 attr( ) 可以设置元素…
1.获得内容 三个简单实用的用于 DOM 操作的 jQuery 方法: text() - 设置或返回所选元素的文本内容 html() - 设置或返回所选元素的内容(包括 HTML 标记) val() - 设置或返回表单字段的值 <p id="test">This is some <b>bold</b> text in a paragraph.</p> <p>Name: <input type="text&quo…