locked
onclick event can be set using jquery or js. is it possible to set an event using css or xslt RRS feed

  • Question

  • User2102072086 posted

    hi,

       I have a span on my page. where I can very easily put onclick event but what I want is, "on click" event should be added on "onload" of the webpage. which can be done using jquery or js.

    but I want to know. is it possible to do it using css or xslt.

    yours sincerely

    Saturday, December 14, 2019 3:03 PM

All replies

  • User475983607 posted

    but I want to know. is it possible to do it using css or xslt.

    The most likely answer is no.   CSS is for display but there are active selector which might be enough to fulfill your requirement.   XSLT is an XML style sheet and can be used to generate HTML and JavaScript.

    Saturday, December 14, 2019 3:10 PM
  • User1535942433 posted

    Hi rajemessage,

    As far as I think,CSS could execute onclick event. It relies on the  pseudo-class and on the general sibling selector ~.

    However,the onclick event isn't same with those which are set using javascript.It only be used in the Foreground code and change the style of page.

    More details,you could  refer to below article:

    https://tympanus.net/codrops/2012/12/17/css-click-events/

    Best regards,

    Yijing Sun

    Monday, December 16, 2019 10:04 AM