1,105,380 Community Members

could someone help me read the following explanation ?

lanhaibibo
Newbie Poster
4 posts since Jun 2013
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
-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  -->

        }
Member Avatar
Troy III
Practically a Posting Shark
891 posts since Jun 2008
Reputation Points: 174 [?]
Q&As Helped to Solve: 119 [?]
Skill Endorsements: 10 [?]
 
-1
 

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

lanhaibibo
Newbie Poster
4 posts since Jun 2013
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

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

Member Avatar
JorgeM
IT Addict
6,418 posts since Dec 2011
Reputation Points: 581 [?]
Q&As Helped to Solve: 963 [?]
Skill Endorsements: 172 [?]
Moderator
Featured
Sponsor
 
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.

Member Avatar
almostbob
Nearly a Senior Poster
3,390 posts since Jan 2009
Reputation Points: 515 [?]
Q&As Helped to Solve: 425 [?]
Skill Endorsements: 14 [?]
 
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 three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: