adspace


When I click on a link in web page.Link should open in new
window.can anyone please let me know the script for this

---Koti

Answer Posted / Chandan Kumar

[Script to open links in a new window using JavaScript] n
1. Create an HTML anchor tag with the desired URL as the href attribute:

<a href="your-url" target="_blank">Click here</a>

2. If you need to dynamically generate the link, use JavaScript to create and append the anchor tag to your page:nn var link = document.createElement('a');n link.href = 'your-url';n link.target = '_blank';n link.textContent = 'Click here';n document.body.appendChild(link);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to use the regular expression for the below code-- swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:56" There is a tree view window of the folder's ie Medication- >Pharmacy(sub folder)with 56 as count of records...The records can be different or if no records present in the specific folder..then it show "Paharmacy:-no records".Whe i record at the first time .....and try to rerun the same script with different records count say "pharmacy:800"..qtp is not regnizing it...therefore i want to user regular expression..but donot now how to use it and where to use...i have tried.... swf("application name").swftreeview ("Treename").select"Medication;Pharmacy:\*"..but it s of no use..plz help..me

3017


What is the registration process and examination fees?

1174


what type of framework u r using in ur organization

2155


I want to open a Notepad window without recording a test and I do not want to use System utility Run command as well. How do I do this?

1306


i need qtp tutorial. pls send it to sridhar.k151@g mail.com

2182


hi i have 4 yrs exp in manual and automation testing using QTP i need sample resumes plz can u send this mail id pbre1980@gmail.com

1948


Hi. please provide license key for QTP 9.2, I have windows XP on my machine Thanks in Advance, moreshwar

3316


we use a file extension .properties why is it used and where do we use it plz help me out with detailed explanation and navigation of how to use on the QTP 8.2?

2156


how can you do retesting (datadriven test) using notepad amd by using functions NOTE u should not use datatable methods

2024


can anyone tell me what to say in interview when interviewer asks about "tell me about your framework in your project"?

2175


can any body plz help by sending the qtp docs and qtp ppt's? this is my mail id:murali.padeti@gmail.com

2332


When to use shared and local object repository?

1168


Please help me by providing the License key for QTP 9.2, at guru_aarya@yahoo.co.in Best Regards Gururaj.B

3455


1.Write a CRITICAL test cases for calculator ? 2.What is the difference b/w FRS and SRS documents ? 3.What is Component ? 4.What is object ? 5.what is the difference b/w static and dynamic descriptive programming ?

2193


any body can you help me what is the script to automate an comand promt

2577