My bad, i kind of forget that point.
So back to the first solution. What you can do is modify the view.html.php file of product to load your js.
It must be added in the form() function like this:
$js = 'yourcode';
$doc = JFactory::getDocument();
$doc->addScriptDeclaration($js);
And you can call the script in the view like this:
<script language="javascript" type="text/javascript">myDropdownFunction(nameOfTheFirstItem);</script>
You can find the name of the first item in the php var $this->element->variants[0]->product_name.
So basically the code is loaded in the page thanks to the three lines I gave you and then you call it inside the view with the first variant. You might not need the first code I gave you but the second is definitely the one that will allow you to execute your JS on page load.