Avatar of Mike Eghtebas
Mike Eghtebas
Flag for United States of America asked on

<a> tag with OnClick()...

I want to add an OnClick event to the following line:
<a id="A4c" href="./Videos.html#UploadVideo" ><abbr title="watch demo video.">Data Upload</abbr></a>

Open in new window


It is supposed to show a message also navigate to href="./Videos.html#UploadVideo".

But this cannot be like alert box because it may mess up navigation.

Question: How can I incorporate something like toast (Demo:http://codeseven.github.io/toastr/demo.html) with this tag?

BTW, when I try something like:
<a id="A4c" href="./Videos.html#UploadVideo" onclcik="showSomething()"><abbr title="watch demo video.">Data Upload</abbr></a>

Open in new window

Understandably, it doesn't work I guess because <a> doesn't function like button on a form. So, how one fire from <a> or basically perform what has been described above?
JavaScriptjQueryHTML

Avatar of undefined
Last Comment
Julian Hansen

8/22/2022 - Mon
Julian Hansen

But this cannot be like alert box because it may mess up navigation.
Can you elaborate?

How will the message be dismissed - must the user click a button or does it just show for a period and then navigate to url.
Mike Eghtebas

ASKER
I have 4 hyperlinks in index.html and 4 descriptions + vidoes on videos.html.

Problem: When user clicks on a hyperlink on index.html, it navigates to vidoes.html but it is not clear to the user which of the videos s/he must concentrate.

Desired solution: The caption of the target video could change color to red, or blink several times.

But because there is no session variables etc, a messaging like toast is also acceptable in the following manner:
1. User clicks on the hyperlink ("Search video").
2. A mesage appears on the upper right corner of the screen telling user "please see item 3. Search video" for example. This message ideally better to appear on vidoes.html and close after a second or two. But, it will be okay just to show this message on index.html just before navigating to vidoes.html. But this simple request may have its own complication causing delay in navigation.

Any other solution helping the user what video to watch is also acceptable.

Thanks,

Mike
ASKER CERTIFIED SOLUTION
Julian Hansen

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Mike Eghtebas

ASKER
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Julian Hansen

You are welcome.