Avatar of trevor1940
 asked on

Jquery Creating object from a Link and where to put the code


Have two Jquery questions

first is it possible to create a object from link to jpg's where the text on the link is image?
for instance

a link
<a href="myPic.jpg>Image 1</a>

jquery object

$("a > href > /image/i").each(function(){
      $(a")atrr("class", "fanceybox"     }

all other links add

$(a")atrr("target", "blank");

Then for links within a table how might i check that $(a")atrr("target", "blank"); hasn't been set or remove it if it has?

My second question is should the jquery script be within the head of the document or can you share the same script by creating a link the same as you would any other javascript eg

<script type="text/javascript" src="/js/my-jquery.js"></script>

i ask this because all the jquery scripts i've seen are either in the head or embeded within the document body.

Avatar of undefined
Last Comment

8/22/2022 - Mon
Jon Norman

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck