onClick does not validate under XHTML Strict

I am one error away from having my new template validate under XHTML 4.01 Strict. I am getting: Line 122, Column 136: there is no attribute "onClick".

Where I use it is in the code snippet.

How can I get this functionality to validate under XHTML Strict?
<a onclick="window.print()" href="#">Print</a>

Open in new window

jen4950Asked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
alexpercsiConnect With a Mentor Commented:
You can eliminate it altogether:

Just write
<a href="javascript:void(window.print());">Print</a>

Open in new window

0
 
hernst42Commented:
do you have onClick or onclick ? and there is no XHTML 4.01 Strict, only HTML 4.01 Strict and there onclick/all attributes are written in lowecase.
0
 
Ray PaseurCommented:
It may not be possible to get it to validate Strict, but this page may lead you to a workaround:
http://www.eionet.europa.eu/software/design/openingnew

HTH< ~Ray
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
jen4950Author Commented:
I'm sorry- typo- XHTML 1.0 Strict; I actually used the javascript fix to getaround the _blank target problem; degrades gracefully..

But the onclick problem is a little more elusive.
0
 
hernst42Commented:
also in XHTML the onclick attribute must be written in lowercase.
0
 
jen4950Author Commented:
I've got it in lowercase- here's the file: http://vacorp.com/common/index.asp
0
 
jen4950Author Commented:
Thank you! Well Done!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.