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