// 一个div里面有一个span标签和多个button标签,每个button标签都有id,span标签没有id,通过点击其中一个button标签,来获取到span标签的text

function (e) {
$(e.target).attr('id').parent().children('span').first().text());
}

jQuery获取兄弟标签的文本的更多相关文章

  1. jQuery获取各种标签的文本和value值

    <select id="test"> <option value ="volvo">Volvo</option> <o ...

  2. Jquery获取select选中的文本与值

    jquery获取select选择的文本与值获取select :获取select 选中的 text :    $("#ddlregtype").find("option:s ...

  3. jquery获取select选择的文本与值

    jquery获取select选择的文本与值获取select :获取select 选中的 text :    $("#ddlregtype").find("option:s ...

  4. jquery获取选中select的文本,值等

    jquery获取select选择的文本与值获取select :获取select 选中的 text :    $("#ddlregtype").find("option:s ...

  5. 用jquery获取select标签中选中的option值及文本

    <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding= ...

  6. jquery获取兄弟元素

    按照w3c school的指引,jquery中,要获得一个元素的兄弟,可以用 prev().next()两种方法.顾名思义,prev()获得前一个,next()获得后面一个. 问题是,如果存在前后兄弟 ...

  7. jquery获取select选中的文本值

    误区: 一直以为jquery获取select中option被选中的文本值,是这样写的:   $("#id").text();  //获取所有option的文本值 实际上应该这样: ...

  8. Jquery获取select标签的值、文本方式

    <script> function add(){            var prop_name=$("#prop").find("option:selec ...

  9. jQuery 获取 select 值和文本

    jQuery("#select1").val();是取得选中的值, jQuery("#select1").text();就是取得的文本.

随机推荐

  1. sql中对查询出的某个字段转换查询

    <select id="queryCmonByLanId" parameterType="java.util.Map" resultType=" ...

  2. ArrayList去除集合中字符串的重复值

    package com.heima.list; import java.util.ArrayList; import java.util.Iterator; import java.util.List ...

  3. SSM详细整合

    SSM(Spring+Spring MVC+MyBatis) 1 简介 SSM 包含三大框架: Spring MVC (web level),采取 MVC 架构,意图取代麻烦的 Servlet 写法, ...

  4. Using Android monkeyrunner from Eclipse, both in Windows and Linux!

    This time I want to use English to make this article useful for all others in the world:) As you kno ...

  5. C基础知识(7):字符串

    在C语言中,字符串实际上是使用null字符'\0' 终止的一维字符数组.因此,一个以null结尾的字符串,包含了组成字符串的字符. C编译器会在初始化数组时,自动把'\0'放在字符串的末尾.所以不需要 ...

  6. C# 实现opc ua服务器的远程连接(转)

    原文转自:https://www.cnblogs.com/dathlin/p/7724834.html OPC UA简介 OPC是应用于工业通信的,在windows环境的下一种通讯技术,原有的通信技术 ...

  7. 移动端1px 边框

    伪类+ transform .border_1px:before{ content: ''; position: absolute; top: 0; height: 1px; width: 100%; ...

  8. python 将视频转换成音频

    安装库 sudo pip install moviepy 代码 index.py from moviepy.editor import * video = VideoFileClip('test.mp ...

  9. flask 之(二) --- 视图|模版|模型

    Flask框架 打开pycharm编译器,新建一个Flask项目,选择提前建好的虚拟环境 . 项目结构: static:静态资源文件,可以直接被浏览器访问 templates:模版文件,必须在项目的p ...

  10. springboot_redis

    1.引入redis的启动器 <dependency> <groupId>org.springframework.boot</groupId> <artifac ...