-3

I want to pass the info variable in the tag's attribute DATA. But Variable info is not passing , please help me how i can use info variable correctly. Thanks in Advance.

 document.getElementsByClassName('modal-body')[0].innerHTML='<object type="text/html" data="update_league.php?updated_id=info"></object>';
Jazba
  • 71
  • 6
  • do this document.getElementsByClassName('modal-body')[0].innerHTML=''; – Nischal Kumar BC Sep 27 '17 at 10:16
  • Possible duplicate of [Best way to concatenate strings in JavaScript?](https://stackoverflow.com/questions/16696632/best-way-to-concatenate-strings-in-javascript) – Albzi Sep 27 '17 at 10:16

1 Answers1

0

From https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Use_data_attributes, use element.dataset. You might need to rename the data attribute to data-something.

Jason
  • 514
  • 5
  • 21