remove
UK[r??mu:v] US[r??muv]
vt.Remove; expel; take off, take off; migrate
vi. Migrate, emigrate; leave
n. Distance, gap; move
attr
英['?tr] 美['?tr]
abbr.attractive Attractive, charming
jquery removeAttr() method syntax
Function: removeAttr() method removes attributes from the selected element.
Syntax: $(selector).removeAttr(attribute)
Parameters:
Parameter | Description |
attribute | Required. Specifies the attributes to remove from the specified element. |
jquery removeAttr() method example
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("p").removeAttr("style"); }); }); </script> </head> <body> <h1>這是一個標題</h1> <p style="font-size:120%;color:red">這是一個段落。</p> <p>這是另一個段落。</p> <button>刪除所有 p 元素的 style 屬性</button> </body> </html>
Click the "Run instance" button to view the online instance