English 中文(简体)
选择隐藏的实地价值的挑选人
原标题:jquery selector for select hidden field value div under a parent div
  • 时间:2011-10-24 09:10:59
  •  标签:
  • jquery

我的图像精彩。 我想在一场小的人群中展示一个形象,因为在 mo化活动中,Gaogle新闻科显示的形象。

我有一个名为<代码>div的班子,称为}=“image-scroll-container”。 根据这一清单,有<编码>divs。 每一条<代码>div 包括<条码>svg 图像,并有一个称为<条码>的类别和<条码>div。 并载有<条码>隐藏的外地,名称为<条码>svg>。

因此,我想从每张关于 mo变活动的图像中获取这一价值。 因此,Pplz告诉我,我如何利用jquery的挑选者获取隐蔽的外地价值。

问题回答

做这项工作(我现在可以检验):

$( div.svg-image [name="svg"] :hidden ).val();

http://api.jquery.com/hidden-selector/

假设你采用以下守则,答案就是这样:

<div class="image-scroll-container">
    <div class="svg-image" onmouseover="getHiddenField(this)">
        <svg>...</svg>
        <input type="hidden" name="svg" value="123456">
    </div>
    <div class="svg-image" onmouseover="getHiddenField(this)">
        <svg>...</svg>
        <input type="hidden" name="svg" value="azertty">
    </div>
    ...
</div>

<script>
    function getHiddenField(element){
            alert($(element).children("input:hidden").val());
    }
</script>

下次请提供超文本例子!

Assuming you want the mouseover event on the dic with the svg-image class, you could something like this:

$( .svg-image ).mouseover(function(){

    // get value of input field. 
    // If container div has more than 1 input, you ll need to refine the selector.

    var value = $(this).find( input ).val();   

});




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签