Your nameContent
variable is inside the function scope and not visible outside that function so if you want to use the nameContent
outside of the function then declare it global
inside the <script>
tag and use inside functions without the var
keyword as follows
<script language="javascript" type="text/javascript">
var nameContent; // In the global scope
function first(){
nameContent=document.getElementById('full_name').value;
}
function second() {
first();
y=nameContent;
alert(y);
}
second();
</script>