I want to call a Javascript function in PHP. This does not execute the function but shows the text on the screen:

Code:
	if ((strlen($chooseYear) < 1)) { $chooseYear = date('Y');
echo "messageDefaultYearInserted()"; 
	}
How do I execute a function in a case like this? In this case, the function will write a message in innerHTML in a span.