规则:
$('div[id^="abc-"]')
$('标签名[id匹配类型="关键字"]')
查询类型:^ 从头部匹配,$ 从尾部匹配,* 匹配名称中包含此关键字的
html js部分
<body>
<!--<input type="file" name="file" />-->
<!--<input type="submit" value="上传文件" />-->
<div id ="abc-bb123-ff">
<div>你真坏啊啊</div>
</div>
<div id ="abc-123-ffs">
<div>你好啊</div>
</div>
</body>
<script src="./jquery.js"></script>
<script>
$(function () {
var html= $('div[id^="abc-"]').html();
console.log(html);
var html2= $('div[id$="ffs"]').html();
console.log(html2);
})
</script>