Here are a couple of mistakes ...
- You do not avoid your quotes. Therefore, PHP is not valid.
- You are trying to put HTML inside an attribute, which is also invalid.
The only alternative I could see here is an HTML c element contenteditable="true". This makes it so that the element (per say a <div>) can modify its contents.
<?php $email = "<a href=\"example@link.com\">example@link.com </a>"; ?>
<div id="fake-email" contenteditable="true"><?php echo $email; ?></div>
, .
Edit:
, :
document.getElementById("form").onsubmit = function(){
document.getElementById("email").value =
document.getElementById("fake-email").innerText || document.getElementById("fake-email").textContent;
}
:
<form action="..." method="..." id="form">
<div id="fake-email" contenteditable="true"></div>
<input type="hidden" id="email" name="email" />
</form>
user3117575