HTML Editor
<!DOCTYPE html> <html lang="en-US"> <body> <p>How much you like us?</p> <form oninput="result.value=parseInt(a.value)+parseInt(b.value)"> <input type="range" name="b" value="50"> + <input type="number" name="a" value="100"> = <output name="result">150</output>%<br> <input type="button" onclick="myFunction()" value="Check"> </form> <script> var x = document.getElementsByName("result")[0]; function myFunction(){ var getResult = x.value; alert("You like us "+getResult+"% Thank you!!!") } </script> <p><strong>Note : </strong> We used <a href="/js" target="_blank">Javascript</a> to explain <strong>name</strong> attribute in &lt;output&gt; element.</p> </body> </html>
OUTPUT
×

Save as Private