freelance84 Posted October 19, 2010 Share Posted October 19, 2010 If I want to apply two functions to one mouse click, how is this done? Is it a) onclick="showOther('tweak_help_hide','none','tweak_help_show', 'inline');" onclick="changeValue('help_value','show');" or b) onclick="showOther('tweak_help_hide','none','tweak_help_show', 'inline'); changeValue('help_value','show');" I know this is pretty basic, but i'm getting there Quote Link to comment https://forums.phpfreaks.com/topic/216239-2-functions-to-one-mouse-click/ Share on other sites More sharing options...
trq Posted October 19, 2010 Share Posted October 19, 2010 Wrap them in another function then call that. Seriously though, with the advent of libraries such as jQuery having onClick() events mixed in with your markup is a thing of the past. Unobtrusive Javascript is here. Quote Link to comment https://forums.phpfreaks.com/topic/216239-2-functions-to-one-mouse-click/#findComment-1123773 Share on other sites More sharing options...
freelance84 Posted October 19, 2010 Author Share Posted October 19, 2010 Ok cool Just getting my head into JS, do you think it would be best to jump striaght into jQuery? Quote Link to comment https://forums.phpfreaks.com/topic/216239-2-functions-to-one-mouse-click/#findComment-1123782 Share on other sites More sharing options...
trq Posted October 19, 2010 Share Posted October 19, 2010 While its good to know the underlying technology, you can pretty much learn that while (if need be) you learn jQuery. jQuery is an awesome tool. Quote Link to comment https://forums.phpfreaks.com/topic/216239-2-functions-to-one-mouse-click/#findComment-1123789 Share on other sites More sharing options...
freelance84 Posted October 19, 2010 Author Share Posted October 19, 2010 Well, I've just started getting my head into JS and I think i'm going to continue for the meanwhile. html php mysql and css, i now have a pretty solid (i think) understanding of and i started out by learning the raw basics and building on them as i went. Also at the moment, i'm only applying bit of js here and there, nothing too intensive. Quote Link to comment https://forums.phpfreaks.com/topic/216239-2-functions-to-one-mouse-click/#findComment-1123836 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.