If there is a section of code that produces multiple options, how do we get a click to delete a value in an item?
<%
List<theme> themelist= (list<theme>) request.getattribute ("Topiclist");
if (themelist!=null) {
for (Theme theme:themelist) {
%>
<li><%=theme.getthemename ()%> <a
Href= "Topic_modify.jsp?tname=<%=theme.getthemename ()%>&tid=<%=theme.gettid ()%>" > Modify </a >
<a
href= "#"
Onclick= "Forward (' <%=theme.getthemename ()%> ', ' <%=theme.gettid ()%> ')" > Delete </a></li>
<%
}
}
%>
We can add an onclick event to the A-tag element, create a function, set the arguments at the time of the dynamic generation, notice that the argument needs quotes, or else it will be considered a variable, making the click event invalid.
Functions can be written like this:
The source code that is queried in the Web page is this:
However, this may have some drawbacks, the individual can choose according to the situation, or can be set in the a tag directly jump, append elements in the back.
JSP dynamically generated code, click on the display confirmation operation, according to the operation jump and pass value.