First of all, thank you for your willingness to help! The page related to my original post (see below) is a very complicated page and it would be easier to look at a generic example.
// Original code using .live with a click event
$("input[id^='question_'], label[for^='no_'], label[for^='yes_']", $rounded_box_mid).live('click', function(){
Let’s just look at a generic example where .live() needs to be updated with .on().
$('[id^=generic1_id_]', '[id^=generic2_id_]').live('click', function(){ // generic example
To convert to .on(), I could create two working examples seen below, but then I have to re-use code in both, whereas with the .live() example, I am able to reference both selectors and the code will be executed on a click event for either selector. Also, I am using .live() because the click handler needs to apply to new elements added/created after the DOM is loaded. I know the .on() examples below will work for existing and new elements, but I must separate them because I can’t figure out how to write the code where it will apply to both selectors while using the .on() syntax.
// Generic Example - Click handler for elements with an IDs beginning with "generic1_id_"
$(document).on('click', '[id^=generic1_id_]', function(){
}
AND
// Generic Example - Click handler for elements with an IDs beginning with "generic2_id_"
$(document).on('click', '[id^=generic2_id_]', function(){
}
I have tried this but it is not correct because the ‘[id^=generic2_id_]’ will be interpreted as data not as a 2nd selector.
$(document).on('click', '[id^=generic1_id_]', '[id^=generic2_id_]', function(){ // Won't work
There is surprisingly little I can find in searches to find anything beyond simple examples of converting .live() to .on().