I have a set of radio buttons that triggers a jquery function if a specific value is chosen (via .change())
However, in some cases that value will be chosen by default when the page loads. At the moment I have two separate functions – one inside the .change() event, and a conditional that runs on pageload. I’d like to clean this up, so: is there an event which runs both when a value is changed, and at pageload?
Cheers…
You can trigger your
changeevent on pageload like this –