Results 1 to 2 of 2

Thread: New to Javascript

  1. #1
    Join Date
    May 2009

    New to Javascript

    Gidday guys

    I've decided to learn Javascript. I know Flash AS3, and basic HTML, but figure since some mobile devices don't support Flash, I best learn JS.

    I was wondering two things:

    a) where is a really good beginners tutorial to walk me through it?

    b) how do I create the JS equivalent of a Flash dynamic textfield? The project I'm experimenting with updates a JS variable depending on the combination of drop down box selections the user makes. I'd just like to display this variable in a text field.

    Thanks for your time and help.


  2. #2
    Join Date
    Nov 2003
    Worthington, OH, USA
    Literally hundreds of JS tutorials out there, but if you know AS3 you'll find that most of them won't take you far enough. As to dynamically assigning a value to a text field, HTML has text boxes and other elements that you can use. If I'm not wanting user input into the field though, the simplest thing is to use a <span> element and set the innerHTML property to the value:

    HTML Code:
    <span id="spanToReplace"></span>
    <script type="text/javascript">
    document.getElementById("spanToReplace").innerHTML = "This span now has a value";
    Important thing to remember is that you can't address an element until it has been rendered, so if you put the script in the <head> section you'll need to wait until the document loads before allowing it to execute.
    54 68 65 42 65 61 72 4D 61 79

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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