javascript - How to use data created by JS in PHP? -


this code

<script type="text/javascript"> function countnumber(){   var number = 10;   document.getelementbyid("n").innerhtml=number; } </script> <body onload="countnumber()"> <?php $a = "?"; //<-- here want innerhtml of "n"-id-element echo $a+1; ?> </body> 

how access html-data @ initialization of $a?

you cannot access data way want, php runs on server, files transfered client , javascript runs on client. if need process data calculated javascript, need ajax or forms.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -