Home  >  Article  >  Backend Development  >  关于JQUERY传递参数的有关问题

关于JQUERY传递参数的有关问题

WBOY
WBOYOriginal
2016-06-13 12:34:15788browse

关于JQUERY传递参数的问题
大家好,小弟我想问个问题
场景:一个页面上面有2个按钮,,两个按钮名称分别是数据库里面的信息名称,我希望通过点击这两个按钮,可以获取对应的数据库信息在下方的div层中显示,目前已经可以将该按钮的值给到jquery中,操作如下:
对应的标签信息

       for(循环){     	echo "<a>";<br />
                	echo "<i class=\"dapei_partleft\"></i>";<br />
                    echo "<span class=\"dapei_partmiddle\" title='$type_category_name' name='<span style="color: #FF0000;">$type_category_id</span>' >$type_category_name</span>";<br />
                    echo "<i class=\"dapei_partright\"></i>";<br />
               echo " </a>";}
红色标注的就是整个每个标签对应的值。
jquery代码:
		$(function(){<br />
    		$('.dapei_partmiddle').each(function(){<br />
    			$(this).click(function(){<br />
    				$(this).html($(this).attr('name'))<br />
        		})<br />
    	})

现在我想知道的时候,我如何通过点击某个标签,就把某个标签中的name给调出来,并且放到数据库select语句中
   以上求解,,在线等。谢谢

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn