Quantcast
Channel: Active questions tagged javascript - Stack Overflow
Viewing all articles
Browse latest Browse all 138163

Cannot echo out a .val() function

$
0
0
$commentid = 2; //example
echo "<input id = 'inputthing".$commentid."' value = '".$commentrow."' style = ' background-color: transparent; border: 0px solid; box-shadow: none;'>";
echo "</input>";
echo "<script>";

echo 'var commentvalue'.$commentid.' = $("#inputthing'.$commentid.'").val();';

echo "</script>";


The .val func breaks my code, what did I do wrong? (By the way it isn't a php syntax error if there was I would have seen it when running my code as the errors are displayed this is a javascript error).


Viewing all articles
Browse latest Browse all 138163

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>