$('.manager*').click(function () { var managerid = $('.manager*').data('manager'); $('#manager_id').val(managerid); }); 

Been so

 var managerid = $("div:regex(class, .*manager.*)") 
  • Write your html code and describe in more detail what you are trying to do? - mix

1 answer 1

  1. Your example does not work, because Regular expression (as a selector) in jqurery is not supported in the standard assembly (at least versions 1 and 2), it may be why your code does not work. You need a plug-in to connect

  2. Or it is enough to use: Attribute Starts With Selector

    It will look like this: $('div[id^="manager"]')

    An example can be found here.