How to successfully set a value to a field in JS? tried on.focus but no luck

Hi I'm trying to get my input field to say 'Enter your e-mail address' and when you click on it, it goes away to let the user type it. I tried playing around with on:focus and other various tips on SO but I couldn't manage to get it working. Can anyone point me in the right direction? You can see what I'm talking about at heyscout.com.

In my script tags, I have:

<script type="text/javascript">
JotForm.init(function(){
   $('input_1').hint('Enter your e-mail address');
});
</script>

For my input field, I have

        <div id="cid_1" class="form-input">
          <input type="email" class="form-textbox validate[required, Email]" id="input_1" name="q1_stayIn1" size="30"  />
        </div> 
            <button class="signup_btn" type="submit" class="form-submit-button">
              Okay!
            </button>

It should be working but I'm not completely sure what's the issue.

Thanks for any help!

Answers


In case you don't already know, you can do this with plain HTML if you don't need to support older browsers.

<input type="email" placeholder="Enter your e-mail address" class="form-textbox validate[required, Email]" id="input_1" name="q1_stayIn1" size="30" />

Need Your Help

creating instances of a class that has several readonly properties

vb.net properties immutability instantiation

What is an elegant way to create and initialise instances of a class that has several readonly properties? Passing all values in a constructor would not be very convenient.

Recommendations for music processing library?

audio plot music

I'm in a Music Theory class and for my final, I've decided to code a program that would output simple statistics about a given song. I was wondering, does anybody have any good libraries for such a...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.