PDA

View Full Version : InnerHTML horizontal row problem



makamo66
07-17-2016, 02:48 PM
I want to add a horizontal row after the user clicks on Completed. This javascript isn't working:


function myFunction() {
document.getElementById("green-hr").innerHTML = "<b>Completed</b><br /><hr />";
}

<b onclick="myFunction()" id="green-hr">Completed</b>

How to fix it?

jscheuer1
07-17-2016, 03:02 PM
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

</head>
<body>
<b onclick="myFunction()" id="green-hr">Completed</b>
<script type="text/javascript">
function myFunction() {
document.getElementById("green-hr").innerHTML = "<b>Completed</b><br /><hr />";
}
</script>

</body>
</html>