Why isn't this button firing the anchor tag?

Why not just say in javascript window. Location = "your url and you can do this in the same function that creates your link, if you really have to have a link created on the page And in case you HAVE TO fire a click on the anchor tag, you can do this with jQuery trigger a nice and simple example at api.jquery.com/trigger.

Why not just say in javascript window. Location = "your url"; and you can do this in the same function that creates your link, if you really have to have a link created on the page And in case you HAVE TO fire a click on the anchor tag, you can do this with jQuery trigger a nice and simple example at api.jquery.com/trigger.

Thanks for the tip! – Noor May 30 '10 at 10:09.

You haven't told the new button what to do. For example, try this: . Attr({onclick: 'alert("hello");' type: 'button', class: 'stor blocks red awesome neu', value: vID, id: 'getmylink'}); When you click, you'll get the alert, now just replace it with either `document.

Location="newpage. Html", or what you will.

This didn't work, I think there's something wrong with anchor tag maybe. I've tried setting up an alert to show up when I click the button and it works. Helped me get an idea though, updated the post with the solution!.

+1 for help – Noor May 30 '10 at 10:03.

Sorry, that was a last minute thing I tried, after hours of failing you try all sort of dumb stuff (if you're like me.. which isn't a good thing). Thanks – Noor May 30 '10 at 9:59.

If you want the button to do something, you have to either add an onclick event for it or handle it server side. Something along the lines of: newBtn. SetAttribute('onclick','window.

Location = "' + nyalanken + '";').

Thanks, got the solution! Check the post. – Noor May 30 '10 at 10:09.

My idea is to press a button that takes me to a web page. I've created a thing that dynamically creates a button and an anchor tag. I've uploaded a demo to my site, when you try it out just leave everything as it is.

Click the first button then the add button right away.. then try to click the dynamically created button. Edit: this is optimized for google chrome, haven't tried it out with other browser. Edit 2 (solution): Instead of "triggering" the click function on the anchor tag I simply made a variable that takes the href attribute from the anchor tag and goes to that location through document.location.

Var alink = $(tislink).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions