Hi, I was hoping you could help me, I was wanting to write text to the screen but without re-writing the whole screen (e.g.
document.write();. I wish to take text and put it in a function, modify it, then display it.
So far I have:
Code:
<script type = "text/javascript">
function calculate(text){
var x = "10.0";
var gpa = text.replace(/0.0/g,x);
document.getElementById("text").innerText=gpa;
}
</script>
<p id = text >Your Grade Point Average (GPA) is: 0.0</p>
<button type="button" onclick="calculate(text)">Calculate</button>
Your help would be really appreciated