faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

0 of 8 people (0%) answered Yes
Recently 0 of 8 people (0%) answered Yes

Entry

can i press and hold shift key using javascript when i click link

Apr 8th, 2008 18:38
ha mo, Dave Clark, bhatt gaurang,


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bhatt,
     Since the effect of holding the shift key while clicking a link 
is to open that link in a new browser window, there are various ways 
you may accomplish this using JavaScript.  For example, the following 
two links demonstrate the basic techniques involved.  The second link 
is a toggle which determines whether the first link will open in the 
current window or in a new window.
<p><a href="test.html" id="dynalink">Test HTML</a></br>
<a href="javascript:void(0)" onclick="
 if (this.firstChild.data=='_self')
   document.getElementById('dynalink').target = this.firstChild.data 
= '_blank';
 else
   document.getElementById('dynalink').target = this.firstChild.data 
= '_self';
 return false;">_self</a></p>
Take care,
Dave Clark
www.DaveClarkConsulting.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com