anevins Posted July 31, 2012 Share Posted July 31, 2012 Hello, I want to clear the content in my HTML input fields, that have the class name 'gllr_image_video_url'. My document.write() is only for testing. document.write(jQuery(this)) Returns five objects of my input fields, but I can't grab the values. When I do this document.write(jQuery(this).val()) The document.write never gets executed. I'm just trying to set the value to nothing (below), if the value of the input is equal to that of a string, 'Video URL'. // Gallery input url focus jQuery(document).ready(function() { var url_input = jQuery('input.gllr_image_video_url'); jQuery(url_input).each(function() { jQuery(this).focus(function(){ document.write(jQuery(this).val()); if (jQuery(this.val()) == 'Video URL'){ jQuery(this.val()) = ''; } else { // } }); }); }); Any ideas why this isn't happening? Quote Link to comment https://forums.phpfreaks.com/topic/266489-jquery-val-not-working-on-object/ Share on other sites More sharing options...
anevins Posted July 31, 2012 Author Share Posted July 31, 2012 Errr can't modify the previous post. But the document.write is working now, however I can't get into the following if statement Quote Link to comment https://forums.phpfreaks.com/topic/266489-jquery-val-not-working-on-object/#findComment-1365622 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.