Javascript Single event two action

<Muralidharan@discussions.microsoft.com> wrote in message
news:42c7b058-69db-452b-ac5d-47fdc8924d3e@discussions.microsoft.com
> In javascript, Text box can I do more than one operation on a single
> event if yes means How
>
> for eg: on text box click event I want to change the color as well as
> i want to call javascript function.
Well, you can always write yet another function that changes the color, then calls the original function, then use this new function as an event handler. Or, you can simply write
 
<input type="text" onclick="this.style.color=someColor;someFunction();">

--
With best wishes,
    Igor Tandetnik


Answer this question

Javascript Single event two action

  • Adam Tybor

    Hi,

    If you are after an IE specific method, then you can look at attachEvent method:

    http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/attachevent.asp


  • D4Soft

    hi,
    In javascript, Text box can I do more than one operation on a single event if yes means How

    for eg: on text box click event I want to change the color as well as i want to call javascript function.

    bye
    muraliIdea

  • Javascript Single event two action