$( document ).ready(function() { $('body').on('click', '#export-btn', function(event) { //do stuff }); });
var selected = ""; $('input[name=selected]:checked').each(function() { selected = selected +$(this).val()+","; }); alert(selected);
jQuery(window).bind(‘beforeunload’,function(e){
//save info somewhere
return ‘are you sure you want to leave?’;
});
jQuery(window).unload(function(){
//I will call my method
});
var elements = jQuery(‘<div><div>Live Customer Spport</div></div>’);
var found = jQuery(‘.head’, elements);
console.log(elements);
alert(elements.html());
alert(found.html());
var textval=$('data').val(); var regex =/^[A-Za-z0-9 ,]+$/; if( !regex.test(textval) ) { alert('tex should not be empty or invalid character \nsupported character are A to Z, a to z, 0 to 9 , space and comma ( , ) '); return false; }
jQuery('#myfrom').on('click','.enable_upload',function(e) { if(jQuery(".enable_upload").is(':checked')) alert('checked'); else alert('Not checked'); });