I’m having trouble selecting the input value from this html:
<li class="t-item">
<div class="t-mid">
<span class="t-in t-state-selected">102/NAH</span>
<input class="t-input" name="itemValue" value="subject:4033" type="hidden">
</div>
</li>
I can get the value of the <span> element using the following:
var text = $("#TreeView .t-state-selected").text();
How do I get the value of the sibling <input> element?
Here’s the complete function, if it helps give some context (the event is a Telerik TreeView OnLoad event):
function OnLoad(e) {
// _lastSubject is known, find the selected node and get the detail
var treeView = $('#TreeView').data('tTreeView');
var text = $("#TreeView .t-state-selected").text();
console.log("ugh, what I really want is the sibling input value");
}
Try the following
This solution is a bit more robust because it will guarantee it gets an
inputelement vs simply the next element of any type.