C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » JavaScript »

How to asign href (anchor tag) in java script in a loop.


Posted Date: 31 Oct 2009      Posted By: Vivek Sharma      Member Level: Gold     Points: 1   Responses: 1



Hi friends, below is the code, during the search that java script code finds the results, but that is not clickable.
I want as it find the result during that time to assign anchor tag (href) with that result in "url"

for(i in results)
{
var obj = document.getElementById("Select1");

var strId = AddItem(obj, results[i]['titleNoFormatting'], strId);

URLArray[obj.length] = results[i]['url'];

}

Regards
Vivek Sharma





Responses

Author: MuniHemadriBabu.Jogi    31 Oct 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi

You can use like below

document.getElementById('link1').innerHTML="hyperlink text";
document.getElementById('link1').href="http://www.url.com";
document.getElementById('link1').target="_blank";



Post Reply
You must Sign In to post a response.
Next : How to make numeric textbox
Previous : Change Image name dynamically
Return to Discussion Forum
Post New Message
Category: JavaScript

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use