if(Drupal.jsEnabled) { $(document).ready(function() { var resetValue = ''; $('#first_name').bind('click', function(event) { resetValue = $(this).attr('val'); // Do the manipulation of value if ($(this).attr('val') == '') { $(this).attr('val', resetValue); } $(this).attr('val', 'changed value...'); }); }); }