In my application, I want to make the image a link to another page. The image is placed in html as,
<div class="rightbuttoncontainers_footer"> <div class="forfooterimg" id="twitterlink_indv"> <img src="Images/tweatus.png" width="30" height="30" alt="tweat"> </div> </div>
I want to make this image as links through a script, I tried the following
var twit_lk='https://twitter.com/'; $('#twitterlink_indv').append('<a href="'+twit_lk+'"/>');
But the output of the above code is as follows:
<div class="rightbuttoncontainers_footer"> <div class="forfooterimg" id="twitterlink_indv"> <img src="Images/tweatus.png" width="30" height="30" alt="tweat"> <a href="https://twitter.com/"></a> </div> </div>
But I want the result to be as follows:
<div class="rightbuttoncontainers_footer"> <div class="forfooterimg" id="twitterlink_indv"> <a href="https://twitter.com/"> <img src="Images/tweatus.png" width="30" height="30" alt="tweat"> </a> </div> </div>
How can I make it work?
Please, help,
thanks
source share