html - Use PHP to change contents of an element -


for login page, if password incorrect have redirect page. there way insert or show error message shows on error page on regular login page using php, eliminating need error page? jquery ($("#error").css("visibility","visible");, don't know how interact dom using php, because it's executed on server.

you can make javascript(including jquery) , html work using php echoing data. example:

<?php echo "<script>$('#error').css('visibility','visible');</script> ?> 

remember using single quotes in javascript not clash double-quotes of echo function of php.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -