发布网友 发布时间:2022-04-22 09:55
共2个回答
热心网友 时间:2022-04-20 11:31
<!doctype html>
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<li>
<div class="vt-el-inner">
<div class="inner-logo">
<img src="../PPIMG/001.jpg">
</div>
<div class="inner-title"><span>1</span>马格全屋定制</div>
<div class="inner-btn">
<div class="vote-count fl">79票</div>
<button class="vote-send fr" onclick="asd(this)">投TA一票</button>
</div>
</div>
</li>
<li>
<div class="vt-el-inner">
<div class="inner-logo">
<img src="../PPIMG/002.jpg">
</div>
<div class="inner-title"><span>2</span>马格全屋定制</div>
<div class="inner-btn">
<div class="vote-count fl">7票</div>
<button class="vote-send fr" onclick="asd(this)">投ta一票</button>
</div>
</div>
</li>
<script type="text/javascript" src="jquery-3.2.1.js"></script>
<script type="text/javascript">
function asd(obj){
var ret = $(obj).parent().siblings(".inner-title").find("span").html();
console.log(ret)
}
</script>
</body>
</html>
需要引入jquery
热心网友 时间:2022-04-20 12:49
点击+ 执行一个js函数 在函数中用ajax获取你冲数据库中取出的信息,再用js把获取的信息插入div中,并且把+改成-
点击-直接把div的样式属性设置为隐藏 并且把-VK成+