PHP$value
をJavaScriptに貼り付けて表示しようとしましたが、値を取得できません。
<script language="JavaScript">
function here(elemento){
alert (elemento);
}
</script>
<body>
<?php $value= 1?>
<!--Al hace llamado a la función solo tienes que idicar el nombre del DIV entre parentesis -->
<p><a href="#" onclick="here('.$value.')" title="">Mostrar / Ocultar</a></p>
<div id="contenido_a_mostrar">
<p>Este contenido tiene que mostrarse con el link</p>
</div>
</body>
これを試してみます<p><a href="#" onclick="here('<? php echo $value; ?>')" title="">Mostrar / Ocultar</a></p>
しかし、アラートは私にこれを示しています<?php echo $value?>