How to put jquery result in text field. Here is the code:
jquery:
$(document).ready(function () {
$('p, li, a, href').click(function () {
var xpath = getXPath(this);
alert(xpath);
});
});
and HTML text field:
<input name="" type="text" value="">
What I need is instead alert put result in text field?
UPDATE:
Sorry for my bad question…
The result must be in selected text field:
<input id="" name="" type="text" value="">
<input id="" name="" type="text" value="">
<input id="" name="" type="text" value="">
and must write result in selected text field…
you can use this to select the focused element
this one is even much better that you give them all a name for example:
then select them like this:
if your textbox loose focus when you try to trigger script do this:
then in your sctipt use:
make sure that selectedtextbox is global and can be accessed from your script.