+ 1
How do I pass a value from any table cell when clicked to Text box in html using JavaScript?
I want to use this in developing a calculator app in html.
1 Answer
+ 1
Use this as an attribute of the table cells onclick=âtextBoxFunc(this.innerHTML)â
Then the JavaScript would be:
function textBoxFunc(text){
document.getElementById(âtextBoxIdâ).innerHTML = text;
}