Today, we will select radio by default based on the parameter. After finding the data in js for a long time on the Internet and then calling it after loading the page, the result will not work for more than one hour-The js function is not called. Then I changed my mind and determined the checked value of each radio directly based on the parameter in the Servlet. Finally, we can select radio by default. It is difficult to judge the value of each radio based on the parameter. Finally, a usable and simple method is found. The Code is as follows: <% int vol = (Integer) request. getAttribute ("cardtype"); %> <input type = "radio" value = "5" id = "5" <% = vol = 5? "Checked": "" %> name = "appendAmount3"> <input type = "radio" value = "10" id = "10" <% = vol = 10? "Checked": "" %> name = "appendAmount3"> This eliminates the need to use js functions.