list of all jquery function

Advertisements

check uncheck all check box using javascript and jquery

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; } }}}
Your ckname are
name 1
name 2
name 3
name 4
name 5
name 6

Select / Unselect All

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; } }

}

}

Your ckname are

name 1

name 2

name 3

name 4

name 5

name 6

Select / Unselect All

$.ajax method ,

function submitform(){var dataString = ‘name=’+ $(‘#name’).val() + ‘&email=’ + $(‘#email’).val() ; alert (dataString); $.ajax({ type: “POST”, // you are also use GET Method url: “http://rajeevphp2011.blogspot.in/&#8221;, // get value in this page ex: $_POST[‘name’]; data: dataString, success: function(data1) { // alert(data1); if(data1==’success’) { alert(‘Successfuly send ‘); return false ; } else { alert(‘please try again’); return false ; } } }); return false ; }

Name
Email

function submitform(){
var dataString = ‘name=’+ $(‘#name’).val() + ‘&email=’ + $(‘#email’).val() ; alert (dataString); $.ajax({      type: “POST”, // you are also use GET Method       url: “page.php”, // get value in this page ex: $_POST[‘name’];      data: dataString,      success: function(data1) {  alert(data1);  if(data1==’success’) { alert(‘Successfuly send ‘);   return false ;      } else {    alert(‘please try again’);    return false ;    }    }     });   return false ;   }

  

 

   

   

 

 

   

   

 

 

   

 

Name  
Email

   
          

how to add and remove class using jquery

Add Remove Class using jquery function addcls(){ $(“#name”).attr(“class”,”classname1 classname2″); }function removeclass(){$(“#name”).removeAttr(“class”)}.classname1 { width:300px; border:1 px solid #FF0000; color:#FF0000; }Name :

 
function addcls(){

 $(“#name”).attr(“class”,”classname1 classname2″);  
}

function removeclass(){
$(“#name”).removeAttr(“class”)
}

Name :

on click Enable and Disable check box on jquery

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”);}}

click   Show   Add   Edit   Delete  

code : 
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”);
}
}
   

 

click  
 

Show  
 

Add     
 

Edit   
 

Delete