JavaScript: I want onclick() to tell me href value ?

2 views
Skip to first unread message

Audrey A Lee

unread,
Aug 20, 2009, 6:47:46 AM8/20/09
to forumgrouper
Hello,

I'd like to write a simple function which returns the value of the
href attribute.

I have this a-element:

<a onclick="sayhref()" href="#helloworld">hi</a>

I want sayhref() to return "#helloworld"

Tips anyone?

-Audrey
Reply all
Reply to author
Forward
0 new messages