usefull jQuery | jQuery importance

set width in percentage using jquery

<div id="IDofDiv" />
$('div#IDofDiv).width('90%'); <div id="IDofDiv" style="width: 90%;"/>

Clearing <input type='file' /> using jQuery

clear an <input type='file' /> control value with jQuery
  $("#control").replaceWith("<input type='file' id='control' />");
<input type="file" id="control" />

How to get the length of  textbox value or string using jQuery?

var myLength = $("#myTextbox").val().length;

How to check if an element has a particular class

jQuery is() is the function that checks if any of the returned DOM objects from the selector satisfies the criteria set in the argument.
if ($(#elm).is('.classname)) { //#elmement has the class } else { //#elm doesn't have the class }

Post a Comment

0 Comments