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  -->

        }

Recommended Answers

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.

Jump to Post

All 4 Replies

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

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

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.

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.