Replacing an existing HTML element?

nintendodsg

New Member
currently I am trying to replace a simple HTML element to alert the user that the password/username they have entered does not exist. I'm new to programming and I'm not sure what I'm doing is not working simply because it does not work or because I've made and error somewhere.Here is the Php code excerpt:\[code\]if($player['id'] == false)echo "<script>document.getElementById('alert').innerHTML='That username does not exist.'; </script>";\[/code\]And then farther down I have this in HTML:\[code\]<p id="alert">Enter your Username and Password Above.</p>\[/code\]I'm trying to replace the "Enter your Username" part with the "username does not exist" bit. Is this the best way to go about it?
 
Back
Top