Javascript text box value with getElemendById()

Posted on 2007-10-05
Last Modified: 2012-05-05
I have a text box:

<input id="newAlbumName" onBlur="alert('val='+document.getElementById('newAlbumName').value)"  type=text name='newAlbumName' value="1234">

When the onBlur event is triggered, it alerts me with "val=".  Can anyone tell me how to get it to alert me with "val=1234", or whatever the value of the text box is?

Question by:burnsj2
    1 Comment
    LVL 25

    Accepted Solution

    <input id="newAlbumName" onBlur="alert('val=' + this.value)"  type=text name='newAlbumName' value="1234">

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Hire Freelancers to Complete JavaScript Projects

    Source the talented Expert Exchange community
    for top quality work on your JavaScript projects.

    Hire the best. Collaborate easily. Get quality work.

    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now