How to get the value of an element at the previous level

Code:
< input id= "number0" name= "number" type= "text" value= "1" class= "number_text" >
< href= "- sharp" onclick= "addNum (this)" id= "add0" class= "jia" > + < / >

function addNum (a) {

alert(a.prev("input").text());

}
because the a tag will be converted on the web page, I remove the a
question: I want to get the value of input, but this doesn"t work. What value should be passed in, addNum () parentheses, and how to get the upper-level element

Mar.06,2021

this does not have a prev () method
$(this) only.

in jQuery, it is not recommended to use onclick, to directly use element selector operations:


jsjQuery

// <a><b1 id="b1"/><b2 id="b2"/></a>

alert(document.getElementById("b2").previousSibling.id); // "b1"
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b365bb-2c020.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b365bb-2c020.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?