I have the following HTML:
<div data-name="countrySelectorRoot">
<select>
<option value="C1">Country 1</option>
<option value="C2">Country 2</option>
<option value="C3">Country 3</option>
<option value="C4">Country 4</option>
<option value="C5">Country 5</option>
</select>
<script type="text/javascript">
// Some script which finds parent div...
</script>
</div>
Inside script, I need code which needs to find my "countrySelectorRoot" div (var MyRoot = // Code that finds element with data-name="countrySelectorRoot").
However, I can have multiple divs with same data-name attribute and same contents, but I need to find the the specific one which is the parent of the script.
How to do this?