Jump to content

Help with onclick


phoenixfreefall

Recommended Posts

Hi, I'm new to Javascript, but I'm really trying to learn to improve my website. So what I'm going for is to use onclick so visitors can click an event in a calendar and it will show the time and location info. There's probably a better way to do this, so I'm open to other suggestions. The main problem I'm running into is that I'm using the onclick in either a p element or an h element right now so it's not evident to visitors that the calendar event can be clicked. Example of what I'm doing:

<p onclick="document.write('Event + Time and Location')>Event</p>

Any suggestions would be welcome, I'd like to learn a clean way to do this. I'm currently using a premade calendar template since I think coding a whole calendar is beyond me at the moment.

Link to comment
Share on other sites

Well, you could use CSS to make the paragraph look like a link.Btw, you forgot the closing quotation mark on the onclick attribute.So, you could do something like this:

<p onclick="document.write('Event + Time and Location')" style="cursor:pointer; color:#0000FF; text-decoration:underline; ">Event</p>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...