I just started working in Javascript. I have implemented onchange event in JS through code:
<html>
<head>
<script>
function fun()
{
var x=document.getElementById("price1");
document.forms['forms1'].price.value=x.value*2;
}
</script>
</head>
<body>
<form name="forms1">
Enter Price: <input type="text" id="price1" onchange="fun()">
value is: <input name="price" type="text" >
</form>
</body>
</html>
But problem is that I get output like
value is: |__|
but I want it like a paragraph without input tag (i.e not in a box). I want it to be changed like a text. e.g value is: 20 not value is:|___20___|. Any help?
innerHTMLof aptag or remove the borders from your input with CSS.