I am trying to fix someone else’s code and I have lines like this throughout my javascript –
var dataDiv = document.getElementById("ctl00_cpMain_tcMainTabs_tResBDetails_tcDetailTabs_tBDetail_bmrDetailDataDiv")
What is the preferred syntax?
FYI, this is a jQuery enabled web application.
A trick we used to use but became redundant when we moved to MVC was something like this, easier when you use jquery as well
Then you can call it using jquery as
or simplified if you don’t need to use it anywhere else on the page is
you could use a match identifier but personally I don’t think it is as elegant