how to use data-target= #login_form in jquery code example Example: how to add data modal target attribute in jquery $('#testButton').attr('data-target','#testModal2');