Hi i want to use jsp variable value in javascript How can i use
Here is my code.
Demo.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%
String plane="A";
%>
<script>
var planB=<%=plane%>;
c
if(planB==B){
document.write("shakti");
}else{
document.write("sharma");
}
</script>
</body>
</html>
How can i get my desired output
var planB='<%=plane%>';