+ 1

whats the problem in my calculator css writing

<!doctype html> <html> <head> <script> function insert(num){ document.form.textview.value=document.form.textview.value+num } </script> <style> *{ margin: 0; padding:0; } .button { width: 50; height: 50; font-size: 25; margin: 2; cursor: pointer; } .textview { width: 217; margin: 5; font-size: 25; padding: 5; } </style> </head> <body> <div class="main"> <form name="form"> <input class="textview"> </form> <table> <tr> <td><input class="button" type="button" value="C"></td> <td><input class="button" type="button" value="^"></td> <td><input class="button" type="button" value="/"></td> <td><input class="button" type="button" value="*"></td> </tr> <tr> <td><input class="button" type="button" value="7"></td> <td><input class="button" type="button" value="8"></td> <td><input class="button" type="button" value="9"></td> <td><input class="button" type="button" value="-"></td> </tr><tr> <td><input class="button" type="button" value="4"></td> <td><input class="button" type="button" value="5"></td> <td><input class="button" type="button" value="6"></td> <td><input class="button" type="button" value="+"></td> </tr><tr> <td><input class="button" type="button" value="1"></td> <td><input class="button" type="button" value="2"></td> <td><input class="button" type="button" value="3"></td> <td><input class="button" type="button" value="="></td> </tr> </table> </div> </body> </html> (the "textview" and the "button" is not working on the <style> attribute I

3rd May 2019, 5:58 PM
Tareq Rahman
Tareq Rahman - avatar
3 odpowiedzi
+ 4
Tareq Rahman The insert() function is not invoked anywhere in your code. If the function is not invoked the code inside of it will not be executed. Use the Event attribute "onclick" with the button class inputs https://www.w3schools.com/tags/ev_onclick.asp https://code.sololearn.com/WN947T82Nn2V/#html
4th May 2019, 7:23 PM
ODLNT
ODLNT - avatar
+ 3
You're welcome
4th May 2019, 7:48 PM
ODLNT
ODLNT - avatar
+ 1
Thank you brother
4th May 2019, 7:30 PM
Tareq Rahman
Tareq Rahman - avatar