【JavaScript】获取所有相同class名称的控件


var editStr = "    "+PropertyName+" " ;  

var jsonarray = [];
var arr = "";
$(".spanProperty").each(function(){
    if($(this).text()!=''){ 
        arr = 
          {
              "id": $(this).text().split('-')[1],
              "name": $(this).text().split('-')[2],
              "pId": $(this).text().split('-')[0],
              "IsProperty": 2
          }
        jsonarray.push(arr); 
    } 
})