View Full Version : Defining onClick Using CSS


Opv
12-10-2004, 10:16 PM
I am experimenting buttons. I am curious as to whether there is a way to control the onClick response through CSS. Specifically, I want to be able to automatically have all buttons set to onClick="this.blur();" without having to manually type the instruction for each new button that is created. Is this possible via a CSS style sheet?

Opv

MaGiCSuN
12-10-2004, 10:20 PM
you do have this:

"filter:Blur(direction=45, strength=40)"

IE only though. I'm not sure if it does the same as you want, but onclick is still a javascript action. CSS can only style things, can't take actions :)

Love,
Mirna

Opv
12-10-2004, 10:37 PM
Thanks. Bear in mind that I am a novice. Could you expound on that code, a short example of how it would be applied, etc? Thanks again, Opv.

MaGiCSuN
12-11-2004, 03:54 PM
mostly a button is <input> if so then you could do this:

<style type="text/css">
<!--
input { filter:Blur(direction=45, strength=40); }
-->
</style>

not sure if it works though, i can't test it at the moment :)

love,
Mirna