This is a precautionary measure that you can adopt, if you are doubtful about the presence of a particular control in the page. Under normal scenarios, in case if the element is not there, it would throw an error. But you can now check if that particular element is present in the page or not, by just using the html() method in jQuery. Check the code snippet below:
alert(‘x is missing’);
<input type=”text” id=”xxx” value=’xcvxvcxcv’/>
When you load the page, it will throw the popup with the message ‘x is missing’. Now replace the id of the input textbox from ‘xxx’ to ‘x’ and load the page. The popup would show ‘x exist’ message. Hope this was useful.