1.11M Members

could someone help me read the following explanation ?

 
-1
 
function smile ()
        {
            document.getElementById("textfield_width").value = width; 
            //set the elements with id "textfield_width" some value the value of the variable width-->
            document.getElementById("textfield_height").value = height; 
            // set the elements with id "textfield_height" some value the value of the variable height  -->

        }
 
-1
 

Don't bother with it because it's wrong;
Completely wrong!

 
0
 

really ? what is wrong here ? Could you explain it to me ?

 
0
 

Well the snippet above shows you comments that indicate the purpose of the code. You are missing the width and height variable declarations and assignments.

 
0
 

the comments are included,
this is not a function, this is an explanation of how part of a function could be coded.
It is incorrect, the explanation refers to "elements with the id", when ID is singular and multiple elements cannot have the same ID,
throw it away and get a different tutorial, from somebody who has a basic idea of what they are doing

set the elements with id "textfield_height" some value the value of the variable height

You
This article has been dead for over six months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: