2
Answers

getElementbyId.style doesn't appear in external js file intellisense

Steve Bradwell

Steve Bradwell

15y
4.8k
1
Hi All, I'm new to asp.net developement.

I'm trying to resize the height of a side nav div via js as the content panes for various options are loaded into hidden divs of variable height. The code:

var contentDom = document.getElementById("main-content");
var sidebarDom = document.getElementById("sidenav-content");
var temp = contentDom.offsetHeight;
sidebarDom.style.height = temp + "px";
works fine in the header of the aspx page. However, when moved to an exisiting js file I don't get .offsetHeight, or .style, or .innerHTML etc. displaying in intellisense, and these options are not working for me. Any help here is greatly appreciated? many thanks, Steve.
Answers (2)