Fetch and Replace href attribute value of tag using prototype

I have a simple link inside my tml (apache tapestry specific) : www.google.com Now on the browser if I am trying to click the link, actually it's redirecting to `http://localhost:8080/..../..../www.google.com` Instead of it should open a new tab for that link. So the logic which I am thinking is : 1) Fire a javascript on page load 2) Get the href value of anchor tag 3) Append http:// at the start, if it doesn't contains it. So to do this, actually I want to use prototype (javascript framework), and I am bit new to this... How can I write the function using the Prototype.js library?

以上就是Fetch and Replace href attribute value of tag using prototype的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准