cool thanks.

I'm having trouble applying it...
I have an anchor tag like <a href="File Library/ID">Clickity</a>

and i need to build an url like somewhere/?library=File
+Library&component=id

my approach below is only happy when pattern exists (pages with normal
links give js error).  plus this can't be best way.

$("[EMAIL PROTECTED]").addClass("file");
        var library = $("a.file").attr('href').split("/") [0].replace(" ",
"+");
        var id =  $("a.file").attr('href').split("/") [1];

         $("a.file").attr('href','.http://somewhere.com//?library='+library
+'&component='+id);

On Aug 28, 12:43 pm, Mike Alsup <[EMAIL PROTECTED]> wrote:
> > this is probably pretty simple but trying to find documentation on how
> > to change the href value on an anchor tag.
>
> > i've seen docs that let you filter an anchor tag based on class which
> > is prob what i'll do but i need to change the url that it is pointing
> > to href="some/pattern/here" to rewrite to ensure proper encoding (for
> > spaces, etc.) and b/c i want to point it somewhere different.  this is
> > prob not best approach overall but data is not easy to change for me
> > so i want to change the url.
>
> > I'll need to do same thing for  tags as well (point src to diff
> > location).
>
> > your help is appreciated.
>
> > also looking for where documentation specifies what properties can be
> > changed.
>
> This is a job for "attr":
>
> http://docs.jquery.com/Attributes
>
> For example:
> $('a').attr('href','http://malsup.com/jquery');
> $('img').attr('src','myimage.jpg');

Reply via email to