I made a verification prompt today. It is necessary to judge whether the attribute el-button–primary exists in the class attribute.
The problem is as follows:
var primary;
$('.card-no').each(function (item,index) {
primary = $(this).find('button').attr("class");
});
if (primary.indexOf("el-button--primary") > -1) {
console.log("已存在")
} else {
console.log("不存在")
}