In my dialog, I have a textbox on the left side and an icon (div) on the right side. When the dialog opens, both elements should be focused.
Here is the HTML code:
<input id="text-link" class="form-control" onfocus="this.select();" onclick="this.select();"/>
<div class="form-control" id="link"></div>
I have tried the following:
1. $("#link").focus();
2. document.getElementById("link")
However, neither of these solutions are working. Can someone please suggest a CSS styling method to dynamically add focus to that div?