opening variable link in new window
I have a wordpress site and one of the plugins pulls school info in to my site. when someone clicks on a school the link is opened on the same page. I would like the link to open in a new window. I have tried and broke the site a number of times.
where would i add the blank target to the below snippet of code?
<h4><a href="{$school["url"]}">{$school["schoolname"]}&开发者_如何学Pythonlt;/a></h4>
<h4><a target="_blank" href="{$school["url"]}">{$school["schoolname"]}</a></h4>
Add the target to the a
tag:
<a href="..." target="_blank">...</a>
Also, to be picky, if you're using an XHTML doctype then the target
attribute isn't valid and a strict solution would be to do the window opening with Javascript. If you're using an HTML doctype (and why not use the HTML5 doctype?), then it's grand.
精彩评论