Jquery good Example with Basic Details

Learn About Jquery :---

A basic introduction to jQuery and the concepts that you need to know to use it.

First using Jquery add or download reference of jqury-1.6.4.min.js ,if  Jquery-1.6.4.min.js is same directory as your html  file ,then you can use


<script type="text/javascript" src="script/jquery-1.6.4.min.js"></script>

 Then after  Write code For Jquery check the document and waits until it's ready to be manipulated.

$(document).ready(function(){

Alert(“Hi Good Morning”);

});

be manipulated inside the ready event, add click  anchor to show Alert :

  <a id="btn1">Press Me</a>    

$(document).ready(function(){

$("#btn1").click(function(){

alert("dhaval");

});

});


Then after if you want to click anchor button and Div Style Change
<div id="divbtn">
Hey<br />How Are you

</div>

$(document).ready(function(){

$("#btn1").click(function(){

$("#divbtn").css({'border':'1px solid red','font-size' : '16px','font-weight':'bold'});

});

});

Sometimes what happened our page load then table height and width problem occurred but jquery is solve that problem when uses facing the height and width problem then use this at runtime and solve it.

I am Change the height and width property of Table at check document  and waits ready for function.

 $(document).ready(function(){

$("#tab1").ready(function(){

$("#tab1").height(120);

$("#tab1").width(120);

});

});

 <table id="tab1" style="border: 1px solid #000000;height:100;width:100;">

<tr>

<td>Hello<br />Hi<br />how Are You</td>

</tr>

</table>


And see Output :

untitled3.bmp
untitled1.bmp