Cascading operation binding events is a very practical technique in jQuery. This article implements this function in the form of examples. Share it with everyone for your reference. The specific method is as follows:
The example described in this article mainly implements jQuery to operate a list, select a school according to the category, click on the school to display the department, click on the department to display the major, and then link to the major application page.
The specific function codes are as follows:
$("li.university").click(function(){ var id = $(this).attr("rel"); $.get("data.aspx?type=u&id="+id , function(html){$("#universityselect").html(html);}); }); $("li.universityselect").click(function(){ var id = $(this).attr("rel"); $.get("data.aspx?type=s&id="+id , function(html){$("#coursetype").html(html);}); }); $("li.course").click(function(){ //var id = $(this).attr("rel"); alert("dd"); //$.get("data.aspx?type=p&id="+id , //function(html){$("#sourseselect").html(html);}); });
I believe that what is described in this article has certain reference value for everyone’s jQuery programming.