Statements

+1 william appiah-dankwah · February 28, 2015
i am having trouble writing statements. i am reading javascript the definitive guide but i am not sure if i have not noticed but it does not give you statement combinations

Post a Reply

Replies

Oldest  Newest  Rating
0 Jay Deshaun · February 28, 2015
What do you mean by it doesn't give you a statement combinations?
0 william appiah-dankwah · February 28, 2015
i don't think you know what i am talking about
0 Jay Deshaun · March 1, 2015
Nope, I don't so far
0 william appiah-dankwah · March 1, 2015
Ok  the book gives you the statement declarations but it does not let you know how to use it with othere statements like document.getElementById  etc if you have read the book you will know what I'm talking about  document.write seems to always work with what iv tried so far
0 Jay Deshaun · March 1, 2015
Oh, do you mean like this:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements
0 william appiah-dankwah · March 2, 2015
Don't you code? year there statements but there not statements that execute the code
0 william appiah-dankwah · March 2, 2015

function Blue(){
var Can = 10; 

document.getElementById("Glue").innerHTML = Can;





}
Blue();

<div id="Glue">cvcbvhgbj</div>


why should the function only work as an onclick event not a normal statement as shown in the code?
0 Jay Deshaun · March 2, 2015
Well if the code is created and the function is called after the page is loaded aka document then it should work doing just what you're trying to do in the code.

http://jsfiddle.net/dgrnezbe/
Source-code:view-source: http://fiddle.jshell.net/dgrnezbe/show/
0 william appiah-dankwah · March 2, 2015
Sorry man I wrote the code it only works with the onclick button  uv checked on a validater 
  • 1

Javascript

107,213 followers
About

A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.

Links
Moderators