Duke Coursera Javascript : Paint
Another priceless one - a must do every few weeks. With practice, you should be able to build this one in about five minutes of coding - that's what it'll take to reach an elite level.
Ok, I hadn't gotten the width-setting right at this point - because I hadn't yet used onchange="functionName()". It's really simple - I thought you needed something elaborate (like this) to be able to process the text-field when ENTER was pressed. But, no. You only need that to do a Google-suggest kind of autocomplete function.. To send the field value, functionName(this.value). Powerful stuff :)
Be sure to use input validation - check that the text field is numeric.
Comments
Post a Comment