登录 | 注册 | FAQ
Anonymous

Hyper link and inserting image

+ 发表回复

3 篇帖子 分页: 1 / 1


Hyper link and inserting image

Chikwado » 周二 12月 09, 2014 5:42 pm

Some one check the following javascript. <html> <body> <p id="message"></p> <script> var person="my javascript excutable text here"; var people="Another javascript excutable text here"; document.getElementById("message").innerHTML= person + "<br>" + people;</script> </body> </html> When I process this code it show me result: my javascript excutable text here. Another javascript excutable text here. Ok, my question is this: Is it possible to insert image or hyper link in that excuted javascript text? Some one help.
头像

Chikwado

  • 帖子: 87
  • 注册: 周一 7月 29, 2013 11:36 pm
  • 地址: Nigeria
--
Focus On Advance Science And Programming.

Re: Hyper link and inserting image

XainPro » 周四 12月 11, 2014 11:17 am

yes you can do it like this

代码: 全选
<html> <body>
<p id="message"></p>
<script> var person="<a href='index.html'>Hyper Link</a>"; var people="Another javascript <img src='image.jpg' /> text here"; document.getElementById("message").innerHTML= person + "<br>" + people;</script>
</body> </html>
头像

XainPro

  • 帖子: 3933
  • 注册: 周五 2月 17, 2012 8:10 pm

Re: Hyper link and inserting image

Chikwado » 周五 12月 12, 2014 7:23 am

Congratulations! Thanks a lots.
头像

Chikwado

  • 帖子: 87
  • 注册: 周一 7月 29, 2013 11:36 pm
  • 地址: Nigeria
--
Focus On Advance Science And Programming.


+ 发表回复

分页: 1 / 1