too long

Just want to ask a question if this is possible ?

$('element').each(function(){
    var name  = $(this).attr('name');
    var n     = name.replace(/-/g, '_');

    var ep  = '<?php echo $user_quest1["'+n+'"]; ?>';
    alert(ep);
});

I got nothing.. Is there a way to do that?

Thanks

It's must keep in mind that PHP execute on server side, while javascript on client side. It mean, when client request a web page, server will process the request (PHP will execute during this process). After this process finished, it will be sent to client browser and then execute javacript code.

PHP runs on the server. JavaScript runs in the browser. You need to use ajax to communicate between the two after the page has loaded, or convert the PHP mapping to something accessible to JavaScript when initially sending the page to the browser.