en
Книги
Steven Bright

JavaScript Fundamentals

  • bakhtiyarцитирапреди 2 години
    Writing into an alert box using window.alert().

    window.alert( 24+ 44 );

    Note that when the script above is tested, an alert window comes up and display the result of 24+44 i.e. 68.

    Writing into the HTML output using document.write() .

    Note that when the button is clicked, a document comes up that displays the result as 68.

    Writing into the browser console, using console.log() .

    console.log( 24 + 44);

    You will need to activate JavaScript console in your browser e.g. Google Chrome using F12 and then type in the above script, you then press enter and it will give you the result as 68.

    Writing into an HTML element, using innerHTML .

    document.getElementById

    ("mon").innerHTML = 24 +

    44 ;

    Note that you set an id property, and the script gets the result as 68, using that Id.
  • b7095677717цитирапреди 3 години
    Strings saved into variables can be added (Concatenated)
fb2epub
Плъзнете и пуснете файловете си (не повече от 5 наведнъж)