I’m using JavaScript and JQuery and when I select a certain page in my application, an id within the content div named myId shows the string “No results found”. This means that when I select the page, the search which is included on every page, executes. If there are records to show, I get these records. If not, then I get the “No results found”-string.
What I want is to check the value of myId and when it is empty (“No results found”), I want to hide some controls on that page.
I already tried $('#myId').val(); but it just gives 2 double quotes, even if it’s not empty.
A nice way to probably do is use the data attribute.
If you have no results found, then do the following.
When you want to check, access it as
Check if x is 0, and hide results if true