0

Anyone can fix this it's for solving math problem

Here the html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>LOL</title> <script src="lol.js"></script> </head> <body> <input type="number" id="in0"> <br> <br> <input type="number" id="in1"> <br> <br> <button onclick="solve()">Solve</button> <p id="ok">g</p> <input type="number" id="wew"> <script src="lol.js"></script> </body> </html> And the js function solve(){ var mult = 1 var val = parseInt(document.getElementById("wew").value) var start0 = parseInt(document.getElementById("in0").value) var end0 = parseInt(document.getElementById("in1").value) solve0 = start0 - end0 show = document.getElementById("wew") show.value = solve0 for (start0; start0 < val; start0++) { mult = mult * start0 } alert("Answer =" +mult) }

9th May 2023, 6:01 AM
Leonard
2 Réponses
+ 7
You can save it in web playground and share the link here. That helps in debug easy way... Also mention your difficulty or error details.. edit: solve0 is undefined....
9th May 2023, 6:16 AM
Jayakrishna 🇮🇳
+ 5
Leonard How to share your code: 1. Save it in Code Playground as public 2. Edit your question description 3. Tap "+" button, then "Code" 4. Choose the saved code When writing the code, use indentation. It helps a lot the reader, by making logic structure visible. Also, avoid abuse of blank lines. Use a single one between logic blocks. Also makes your logic clearer to the reader.
9th May 2023, 11:21 AM
Emerson Prado
Emerson Prado - avatar