When I click on any of the radio button , it does not create the table structure. I am getting the id of the radio button that is checked. and checking if a particular button is checked , create table structure accordingly. It does nothing.
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Welcome to JavaScript</title>
</head>
<body>
<h1>JavaScript - Object</h1>
<p> Enter the dimensions(Numbers Only)</p>
<input id= "circle" type = "radio" name= "shape" value= "circle" />Circle<br>
<input id= "square" type = "radio" name= "shape" value= "square" />Square<br>
<input id= "rectangle" type = "radio" name= "shape" value= "rectangle" />Rectangle<br>
<p id= "dim"></p>
<script type="text/javascript" src="Object.js"></script>
</body>
</html>
// JavaScript Code
if(document.getElementById("rectangle").checked)
{
alert("Rectangle");
document.getElementById("dim").innerHTML = '<table id ="table" align = "center"><tr><td> Length </td><td> <input id = "len" type = "text" name = "length"></td></tr><tr><td>Breadth </td><td><input id = "breadth" type ="text" name = "breadth"></td></tr><tr><td></td> <td><button onClick="areaRectangle()" > Area</button></td></tr>';
}
else if(document.getElementById("circle").checked)
{
alert("Circle");
document.getElementById("dim").innerHTML = '<table id = "table" align ="center"> <tr> <td> Radius </td><td> <input id= "radius" type="text" name = "radius"></td></tr> <tr><td><button onclick="areaCicle()" > Area</button></td></tr>';
}
else if(document.getElementById("square").checked)
{
alert("Square");
document.getElementById("dim").innerHTML = '<table id = "table" align ="center"> <tr> <td> Side </td><td> <input id= "side" type="text" name = "side"></td></tr> <tr><td><button onclick="areaSquare()" > Area</button></td></tr>';
}
function areaCircle()
{
// code
}
function areaRectangle()
{
// code
}
function arearSqaure()
{
// code
}