Posts

Showing posts from January, 2020

How to get value of selected radio button using JavaScript ?

How to get value of selected radio button using JavaScript ? To get the vale of selected radio button,create a function that  function gets all the radio button using with the Name attribute and finds the radio button selected using checked property.The checked property  return true or false.If radio button is checked it returns true otherwise it returns false. If we use multiple radio button than each button has its own index value therefore we access  selected radio button using this index value.  After get value we display result in a box using innerHTML.  FOR EXAMPLE  THE FOLLOWING PROGRAM DISPLAY THE SELECTED RADIO BUTTON VALUE <html>     <body>         <input type= "radio" name= "gender" value= "male" >Male          <input type= "radio" name= "gender" value= "Female" >Female           <input type= "radio" name= "gender" value= "Other gende

javaScript Calculator.

Image
javaScript Calculator. calculator using HTML,CSS and javaScrip t. Html code- <html>     <head>         <meta charset="utf-8">         <meta name="viewport" content="width=device-width, initial-scale=1.0">         <link rel="stylesheet" type="text/css" href="style_calculater.css">         <script src="script_src.js">     </head>     <body>     <div class="container">         <div class="dbox"><input type="text" id="display" placeholder="0"><br>         <input type="text" id="display2" placeholder="0">         <div id="box">             <button class="key" value="7" onclick="dis('7')" > 7 </button>              <button class="key" value="8" onclic