I have the following code:
<h2> <c:out value="${Name}"/> </h2>
<img id="deleteSpecialCharacters('screenshot0<c:out value="${Name}"/>Preview')" class="screenshotImg" src="#" alt="screenshot"/>
With the javascript function:
function deleteSpecialCharacters(String) {
var NewString = String;
NewString = NewString.replace(/[^A-Z0-9]+/ig, "_");
return NewString;
}
Since the Java string contains special characters, i want to filter them before its used inside the ID. But since the Javascript function is inside the ID tag, it sees the function as a String.
So how do i call the javascript function inside the id filtering the Java code