Site icon Dotnet Helpers

JQuery

309, 2012

removeAttr() Method

By |Tags: |0 Comments

.removeAttr() Remove an attribute from each element in the set of matched elements. HTML : <table border="1"> <tr><td>This is first table</td></tr> </table> JQUERY: $(document).ready(function() { $("table").removeAttr("border"); }); OUTPUT DOM : <table> <tr><td>This is first table</td></tr>

3008, 2012

attr() Method

By |Tags: |0 Comments

attr() : The attr() method sets or returns attribute values of selected elements. Getting attribute JQUERY : 1 alert($("#img1").attr("href")); From above JQ, the message box will show the link of img1(which element having id as

2908, 2012

click() and dblclick()

By |Tags: |0 Comments

click() : Fire when mouse single click on the matched element. dblclick() : Fire when mouse double clicks on the matched element. Example : $('#singleClick').click(function(){ $('#singleClick').css("border", "1px solid red"); }); $('#doubleClick').dblclick(function(){ $('#doubleClick')..css("border", "1px solid blue");

Exit mobile version