473,407 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Make text behave like hyperlink

Hi, I have an "A" object without an href
<a onClick="openwindow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?
Thanks

Mar 10 '07 #1
4 4861
2g*****@gmail.com said the following on 3/10/2007 2:35 PM:
Hi, I have an "A" object without an href
<a onClick="openwindow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?
Yes, make it a hyperlink...

<a href="nowhere.html" onclick="openwindow();return false">some text</a>

Or, style the A element with CSS.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 10 '07 #2
While the city slept, Randy Webb (Hi************@aol.com) feverishly
typed...
2g*****@gmail.com said the following on 3/10/2007 2:35 PM:
>Hi, I have an "A" object without an href
<a onClick="openwindow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?

Yes, make it a hyperlink...

<a href="nowhere.html" onclick="openwindow();return false">some
text</a>
Or even better, have the link open the file that openwindow() opens, so that
the page is still available to users without javascript...

Cheers,
Nige

--
Nigel Moss http://www.nigenet.org.uk
Mail address will bounce. ni***@DOG.nigenet.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"
Mar 10 '07 #3

"nice.guy.nige" <ni********@deadspam.comwrote in message
news:45***********************@authen.yellow.readf reenews.net...
While the city slept, Randy Webb (Hi************@aol.com) feverishly
typed...
>2g*****@gmail.com said the following on 3/10/2007 2:35 PM:
>>Hi, I have an "A" object without an href
<a onClick="openwindow()">some text<a>
Is there any way to make it behave like a hyperlink? i.e. to have a
hand when the cursor hoovers above it?

Yes, make it a hyperlink...

<a href="nowhere.html" onclick="openwindow();return false">some
text</a>

Or even better, have the link open the file that openwindow() opens, so
that
the page is still available to users without javascript...

Cheers,
Nige

--
Nigel Moss http://www.nigenet.org.uk
Mail address will bounce. ni***@DOG.nigenet.org.uk | Take the DOG. out!
"Your mother ate my dog!", "Not all of him!"

Hi,

How about...

<a href="javascript: openwindow();return false">some text</a>

Hope this helps

Andy
Mar 11 '07 #4
Andrew Bailey said the following on 3/11/2007 7:04 AM:

<snip>
Hi,

How about...
No.
<a href="javascript: openwindow();return false">some text</a>
<a href="thePageToOpenIfScriptIsDisbaled.html"
onclick="openwindow(this.href);return false">
The link Text</a>
Hope this helps
<URL: http://jibbering.com/faq/index.html#FAQ4_24>

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 11 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Mike Mella | last post by:
I built a simple form where a user can enter and post news items to his site (with PHP, into MySQL). He doesn't know much HTML. Is there some way he can enter some simple text to declare...
0
by: Nel | last post by:
I am trying to write a content management section for a web site. I have managed so far to use htmlarea to give users a basic, but user friendly interface by which to edit the page content. ...
6
by: Tina | last post by:
I'm going through a DataGridItem looking to find the text in a hyperlink column. It's not in mydataGridItem.cells(3).text. Where is it? thanks, T
6
by: GaryB | last post by:
Does anyone have any idea how to get the text out of a hyperlink column in a web datagrid? It's a hyperlink column, not a template column so findcontrol does not work and there is no apparent...
3
by: Terry Olsen | last post by:
I have a datagrid filled with shipping records. I would like to make the field that contains the tracking numbers to be links where the user can click and automatically track that particular...
19
by: Joe | last post by:
I have an aspx page (referred to here as page_1) with a datagrid whose first column contains hyperlinks. When a user clicks one of these hyperlinks, he will navigate to another aspx page (referred...
1
by: jeguillo | last post by:
I am trying to retrieve the text within each cell in a datagrid in order to change the color of each cell, depending on the value within that cell. This works fine on the cells that are bound...
3
by: avanti | last post by:
HI, I have a HyperLink in my code. It has a OnClick function defined. I am trying to access the text property of the HyperLink in my JavaScript function. ...
4
by: alun65 | last post by:
I'm attempting to programmatically build up some HTML in the code behind. Like so: // Create Hyperlink HyperLink link = new HyperLink(); link.NavigateUrl = "nice cat"; link.Text = "Cats...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.