I am getting the error "Uncaught SyntaxError: Identifier starts immediately after numeric literal". As I understand, this is from the variable identifier starting with a number, which I'm trying pass through in the function. I saw here to use escape identifiers, but there was no concrete solution on how to add them in when using PHP, which I am having difficulty implementing.
Html
<button class = "btn btn-primary edButton" onclick='edit_function(\""<?php echo $var; ?>"\\")'>action</button>
Js
function edit_function(id) {
...
You can't start a variable in JavaScript with a digit. There is no way to escape it.