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

        }
4
Contributors
4
Replies
16
Views
4 Years
Discussion Span
Last Post by almostbob
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

Edited by almostbob

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.