How to pass variable in onclick?

In php there is a variable $a. How to convey it in the onclick in the input. Ie so
onclick="window.open($a)"
April 19th 20 at 12:31
1 answer
April 19th 20 at 12:33
Solution
onclick="window.open()
Downloads 1 hour to open - Jabari commented on April 19th 20 at 12:36
put a piece of code js and php a piece, then the conversation will be subject - conrad_Tremblay5 commented on April 19th 20 at 12:39
@conrad_Tremblay5,
<?php 
$a = 'Symmetric multivibrator.pdf';
?>
<!DOCTYPE html>
<html>
the <head>
the <script> let a = '<?=$a?>'</script>
</head>
the <body>
 <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="POST">
 <input type="submit" value="Open" name="open" onclick="window.open(a)">
</form>
</body>
</html>
- Jabari commented on April 19th 20 at 12:42

Find more questions by tags PHP