Your code is very vague but you can try something like this -
<input type="text" id="show" value="<?PHP echo $idee; ?>" />
function fun()
{
var show = document.getElementById("show").value);
if (show == "") {
alert("PHP did not load the id");
} else {
alert(show);
alert("welcomee");
}
}