vendredi 30 octobre 2020

As you can see I am trying to create a link elements?

<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. this is the result I am getting




Aucun commentaire:

Enregistrer un commentaire