This jsp
is inside the iframe
which is generated dynamically ,
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/css/chat.css">
<title>Heart JSP page</title>
</head>
<body>
<div id="messageArea" class="divBorder">
<% String intxnId = request.getParameter("intxnId"); %>
Chat Interaction id is : ?<%= intxnId%>
</div>
<div id="enterMessage" class="divBorder">
Your message Area
</div>
</body>
</html>
My iframe
and its id
is generated dynamically.Inside the Iframe I inserted the above jsp page .
Now I need to get the text value of the div with id=messageArea
in the jsp using jquery.
I used ,
var intxnId = `ch54p3443`;
var sss = $("#ch"+intxnId).contents().find("#messageArea").text();
alert("sss : "+sss);
$("#ch"+intxnId)
will be my iframe selector.
But no value is assigned to the variable sss
.