Results 1 to 3 of 3

Thread: Ajax and div...

  1. #1
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default Ajax and div...

    Hi, I've got this code:

    Code:
    function setOutput(){
    
    if(httpObject.readyState == 4){
    
    document.getElementById('whatever').value = httpObject.responseText;
    
    }
    
     
    
    }
    The whole script is getting something, basically, and putting it onto the page... but it only puts it in an input box, not a div.

    For example, it shows what I want with

    Code:
    <input id="whatever" />
    But with

    Code:
    <div id="whatever"></div>
    it does nothing... I'm a newbie with javascript so if anybody could help... thanks.

  2. #2
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default

    Use .innerHTML not .value for divs.

  3. #3
    Join Date
    Jun 2006
    Posts
    4,832
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Tomm View Post
    Use .innerHTML not .value for divs.
    Smashing, it works now. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •