<html>
<head>
<link
href="css/styles.css"
rel="stylesheet">
</head>
<body onload="createImg()">
<h1>My Website</h1>
<p>This is my first
website</p>
<div id='working_area' >
</div>
<script>
function createImg(){
var img=document.getElementById("working_area");
img.innerHTML="<a src='https://www.google.com'>google</a>";
}
</script>
</body>
</html>
So I want to create a hyperlink using this method and not using create elements method Why? Because I want to create a html editor
** Is it possible ?**
Here is the image of results. The link doesn't working.
Aucun commentaire:
Enregistrer un commentaire