Whing Dela Cruz
asked on
alert(innerHTML);
Hi Experts, I have a table name "myTable" with two columns cell(0) and cell(1). In a cell(0), I put button name "Try it" and on a cell(1), I put input type=text with a name "qty." I want to obtain the value of "qty" and display it on alert. HOW? I attached the codes to make experts easy to understand my goal. Thank you!
AlertButtonOnTable.Html
AlertButtonOnTable.Html
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Bryan Tao,
Julian codes is working while yours is not. But I'm still interested with your solution. When I implement your code no alert will come out! Thanks!
Julian codes is working while yours is not. But I'm still interested with your solution. When I implement your code no alert will come out! Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Julian, Thank you for providing Java solutions as i am prefer to Java rather than jQuery. Thank you also Bryan Tao for leading me closer to the solutions. More power to both of you, and God bless!
You are welcome
2. jQuery is JavaScript - it is just a library that makes doing things with the DOM a whole lot easier. In this case it was a simple requirement but when you start getting into complex DOM interactions you are going to find jQuery gets you where you want to go a whole lot quicker.
Thank you for providing Java solutions as i am prefer to Java rather than jQuery1. NB Java does not equal JavaScript - important to make the distinction
2. jQuery is JavaScript - it is just a library that makes doing things with the DOM a whole lot easier. In this case it was a simple requirement but when you start getting into complex DOM interactions you are going to find jQuery gets you where you want to go a whole lot quicker.
ASKER
Thank you Julian, at first, I felt uncomfortable of using it (jQuery) because of the codes that is not understandable to me as I opened and saw codes inside jQuery. Now i realize the advantage of using it compared to the so called Java alone . Thank you once again for this great advice more power and God bless!
I don't know why mine didn't work. Here's the HTML file. It works for me on both Chrome and IE.
test.html
test.html
Simple jQuery solution
Open in new window