I am new to JavaScript.
I have a javascript function which return me country name. Now I have to place this value in the src of iframe. My JavaScript function is as follows:
<script type="text/javascript">
var country = $("#SCountry").val();
function getCountry()
{
var country = $("#SCountry").val();
return country;
}
</script>
I am getting the country value but can't incorporate it in the src of iframe. My iframe src is as follows:
src='https://example.com/?country="javascript:getCountry()"'
It's not working.