JSFiddle - React, Tailwind, and code Playground

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/ui-lightness/jquery-ui.css">
<b>Change the select to see the alert:</b>

<form name="f1" method="post"> 
     The capital of 
     <select name="country" id="country" onChange="alert('LOCAL: ' + capital + '\n\nGLOBAL: ' + window.capital);"> 
          <option selected>Pakistan 
          <option>Iran 
          <option>China 
          <option>India 
          <option>Afghanistan 
     </select>
     is <input type="text" name="capital" value="Islamabad"/> 
</form>

JavaScript

function capital() {}