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