jQuery - Updating all the divs using wildcard selector -


i've jsfiddle, not working.

all want update divs starting mydiv, text, onclick of button. doing wrong or wrong way of doing.

you need use text() instead of val() set text inside divs:

$("#btn").click(function(e){     $('[id^=mydiv]').text('testing divs'); }); 

Comments