Text To Speech
//html script for the calculator form above
<!doctype html>
<html lang="en">
<head meta charset="utf-8"><title>javascript in html</title>
<script>
function clr(){
document.getElementById("result").value="";
}
function percal(){
var p = document.getElementById("per").value;
var b = document.getElementById("result").value;
var s = p+"*"+b+"/"+100;
var n = eval(s);
document.getElementById("result").value = n;
}
function cal(){
var b = document.getElementById("result").value;
var a = document.getElementById("result").value;
b = eval(a);
document.getElementById("result").value = b;
}
function display(val){
document.getElementById("result").value += val;
}
function perclr(){
document.getElementById("per").value="";
}
</script>
<style>
::-webkit-input-placeholder{
color:green;
font-size:small;
}
#button:hover,#button:active{
outline:0px;
background-color:lightgreen;
cursor:pointer;
}
#button{
outline:0px;
width:100%;
min-width:40px;
max-width:44px;
border:1px;
background-color:red;
box-shadow:1px 1px 1px 1px grey;
border-radius:8px;
cursor:pointer;
}
#ebutton:hover,#ebutton:active{
outline:0px;
background-color:lightgreen;
cursor:pointer;
}
#ebutton{
outline:0px;
width:100%;
border:1px;
background-color:red;
box-shadow:1px 1px 1px 1px grey;
border-radius:8px;
cursor:pointer;
}
.p:hover,.p:active{
outline:0px;
background-color:lightgreen;
}
.p{
outline:0px;
width:43px;
border:1px;
background-color:red;
box-shadow:1px 1px 1px 1px grey;
border-radius:8px;
}
table{
background-color:yellow;
}
#result{
background-image:url('ALL.jpg');
padding:3px;
background-size:18px;
background-repeat:no-repeat;
border-radius:8px;
outline:lightgrey;
}
</style>
</head>
<body>
<center><form><table style=" border-radius:8px;" >
<tr><td colspan="4"><input type="text" placeholder="ENTER THE EQUATION" id="result" dir="rtl" ></td></tr>
<tr>
<td><input type="button" id="button" value="1" onclick="display(1)"></td>
<td><input type="button" id="button" value="2" onclick="display(2)"></td>
<td><input type="button" id="button" value="3" onclick="display(3)"></td>
<td><input type="button" id="button" value="+" onclick="display('+')"></td>
</tr>
<tr>
<td><input type="button" id="button" value="4" onclick="display(4)"></td>
<td><input type="button" id="button" value="5" onclick="display(5)"></td>
<td><input type="button" id="button" value="6" onclick="display(6)"></td>
<td><input type="button" id="button" value="-" onclick="display('-')"></td>
</tr>
<tr>
<td><input type="button" id="button" value="7" onclick="display(7)"></td>
<td><input type="button" id="button" value="8" onclick="display(8)"></td>
<td><input type="button" id="button" value="9" onclick="display(9)"></td>
<td><input type="button" id="button" value="X" onclick="display('*')"></td>
</tr>
<tr>
<td><input type="button" id="button" value="C" onclick="clr(),perclr();"></td>
<td><input type="button" id="button" value="0" onclick="display(0)"></td>
<td><input type="button" id="button" value="." onclick="display('.')"></td>
<td><input type="button" id="button" value="/" onclick="display('/')"></td>
</tr>
<tr>
<td colspan="3"><input type="button" id="ebutton" value="=" onclick="cal();"></td>
<td><input type="text" onclick="percal();" placeholder=" %" id="per" class="p" ></td>
</tr>
</table></form></center>
</body>
</html>
<!doctype html>
<html lang="en">
<head meta charset="utf-8"><title>javascript in html</title>
<script>
function clr(){
document.getElementById("result").value="";
}
function percal(){
var p = document.getElementById("per").value;
var b = document.getElementById("result").value;
var s = p+"*"+b+"/"+100;
var n = eval(s);
document.getElementById("result").value = n;
}
function cal(){
var b = document.getElementById("result").value;
var a = document.getElementById("result").value;
b = eval(a);
document.getElementById("result").value = b;
}
function display(val){
document.getElementById("result").value += val;
}
function perclr(){
document.getElementById("per").value="";
}
</script>
<style>
::-webkit-input-placeholder{
color:green;
font-size:small;
}
#button:hover,#button:active{
outline:0px;
background-color:lightgreen;
cursor:pointer;
}
#button{
outline:0px;
width:100%;
min-width:40px;
max-width:44px;
border:1px;
background-color:red;
box-shadow:1px 1px 1px 1px grey;
border-radius:8px;
cursor:pointer;
}
#ebutton:hover,#ebutton:active{
outline:0px;
background-color:lightgreen;
cursor:pointer;
}
#ebutton{
outline:0px;
width:100%;
border:1px;
background-color:red;
box-shadow:1px 1px 1px 1px grey;
border-radius:8px;
cursor:pointer;
}
.p:hover,.p:active{
outline:0px;
background-color:lightgreen;
}
.p{
outline:0px;
width:43px;
border:1px;
background-color:red;
box-shadow:1px 1px 1px 1px grey;
border-radius:8px;
}
table{
background-color:yellow;
}
#result{
background-image:url('ALL.jpg');
padding:3px;
background-size:18px;
background-repeat:no-repeat;
border-radius:8px;
outline:lightgrey;
}
</style>
</head>
<body>
<center><form><table style=" border-radius:8px;" >
<tr><td colspan="4"><input type="text" placeholder="ENTER THE EQUATION" id="result" dir="rtl" ></td></tr>
<tr>
<td><input type="button" id="button" value="1" onclick="display(1)"></td>
<td><input type="button" id="button" value="2" onclick="display(2)"></td>
<td><input type="button" id="button" value="3" onclick="display(3)"></td>
<td><input type="button" id="button" value="+" onclick="display('+')"></td>
</tr>
<tr>
<td><input type="button" id="button" value="4" onclick="display(4)"></td>
<td><input type="button" id="button" value="5" onclick="display(5)"></td>
<td><input type="button" id="button" value="6" onclick="display(6)"></td>
<td><input type="button" id="button" value="-" onclick="display('-')"></td>
</tr>
<tr>
<td><input type="button" id="button" value="7" onclick="display(7)"></td>
<td><input type="button" id="button" value="8" onclick="display(8)"></td>
<td><input type="button" id="button" value="9" onclick="display(9)"></td>
<td><input type="button" id="button" value="X" onclick="display('*')"></td>
</tr>
<tr>
<td><input type="button" id="button" value="C" onclick="clr(),perclr();"></td>
<td><input type="button" id="button" value="0" onclick="display(0)"></td>
<td><input type="button" id="button" value="." onclick="display('.')"></td>
<td><input type="button" id="button" value="/" onclick="display('/')"></td>
</tr>
<tr>
<td colspan="3"><input type="button" id="ebutton" value="=" onclick="cal();"></td>
<td><input type="text" onclick="percal();" placeholder=" %" id="per" class="p" ></td>
</tr>
</table></form></center>
</body>
</html>
Questions related to class 9 polynomial
|
|
|