Posts

Showing posts with the label JQUERY

tooltip jquery example

tooltips jquery example tooltips jquery Demo

get all value of drop down list

One Two Three Fore Five <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script> function getalloption(){ arr=$('#ddlname option') for(i=0; i< arr.length; i++){ alert($(arr[i]).val()); alert($(arr[i]).text());  } } </script> <select name="ddlnane" id="ddlname" > <option value="1"> One </option> <option value="2"> Two </option> <option value="3"> Three </option> <option value="4"> Fore </option> <option value="5"> Five </option> </select> <input type="button" onclick="getalloption();" value="getOption"  />

list of all jquery function

List of jquery function   

check uncheck all check box using javascript and jquery

Your ckname are name 1 name 2 name 3 name 4 name 5 name 6 Select / Unselect All <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script language="javascript"> function selectallCHBox(){ if($('#selectall').attr('checked')){ var inputs = document.getElementsByClassName('chechid'); var checkboxes = []; for (var i = 0; i < inputs.length; i++) {   if (inputs[i].type == 'checkbox') { inputs[i].checked =true; } } } else { var inputs = document.getElementsByClassName('chechid'); var checkboxes = []; for (var i = 0; i < inputs.length; i++) {   if (inputs[i].type == 'checkbox') { inputs[i].checked =false; } } } } </script> </head> <body> <form name="form1" onSubmit="return validate()"> Your ckname are <br> <input type="checkbox...

select radio button using jquery

checked radio button using jquery ('#idOfRadio').attr("checked","checked"); <input type="radio" id="idOfRadio" name="idOfRadio" />

$.ajax method ,

$.ajax({   type: 'POST', // post , get   url: "file.php",   data: {name: "Rajeev", time: "2pm"},   success: function(result,status,xhr){    alert(result); alert(status); alert(xhr);   },   error: function(xhr,status,error){ alert(status);   }     });

show hide div using jquery , how to use show() , hide() function in jquery

Show Hide div using jquery click here for show div show hide div jquery example  Hi , I am Rajeev Dhar Dwivedi <script> function showdiv(){  $("#mydiv").show();    } function hidediv(){ $("#mydiv").hide() } </script> <div id="mydiv" style="display:none; background-color:#FF66CC; width:300px ; height:40px" > <b> Hi , I am Rajeev Dhar Dwivedi </b> </div> <input type="button" onclick="showdiv()" value="Show Div"  /> <input type="button" onclick="hidediv()" value="Hide Div"  />

how to add and remove class using jquery

Add Remove Class using jquery Name :  <script> function addcls(){  $("#name").attr("class","classname1 classname2");   } function removeclass(){ $("#name").removeAttr("class") } </script> Name : <input type="text" name="name" id="name" value="my name" onclick="(this.value='')" /><br /> <input type="button" onclick="addcls()" value="Add Class"  /> <input type="button" onclick="removeclass()" value="Remove Class"  />

on click Enable and Disable check box on jquery

click   Show   Add   Edit   Delete   code :  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script> function EnableCheckBox(x){ var classname = $(x).attr("class"); if($(x).attr("checked")){  $('.'+classname+'action').removeAttr("disabled");  } else { $('.'+classname+'action').removeAttr("checked"); $('.'+classname+'action').attr("disabled","true"); } } </script> <table>     <tr>  <td> click &nbsp; </td>  <td><input type="checkbox" name="subsection-click[]" value="show" class="click" onclick="EnableCheckBox(this);" /> Show &nbsp; </td>   <td> <input type="checkbox" name="subsection-click[]...

how to use .load() function

var url = "file.php"; $("#loaddata").load(url,{},function (responseText, textStatus, XMLHttpRequest) { alert(responseText);alert(textStatus);alert(XMLHttpRequest);   });  

how to know checkbox is checked in jquery

how to know checkbox is checked in javascript, Here we are provide a example similar to that    Select Check box code for this example : <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script> function selectcheckbox(x){ var cls = $(x).attr('class'); if($('.'+cls).attr('checked')){ alert('chek box is checked'); } else { alert('check box is unchecked');} } </script> <form action="" method=""> <input type="checkbox"  name="checkboxname" value="checkboxvalue" class="checkboxcls"  onclick="selectcheckbox(this)"/> Select Check box </form>

how to use focus function javascript

 focu()  function  is use in javascript for focus of input box when you enter any wrong values in inputbox for example email , mobile number .. etc example : Email Id : when you enter wrong email them your cursor blink on input box  code : in javascript  document.getElementById('email').focus(); in jquery     $('#email').focus() ;    where email s id of input box