<html> <head><script type='text/javascript'> $(window).load(function(){ $("body").click(function(){ var s = window.getSelection(); s.modify('extend','backward','word'); var b = s.toString(); s.modify('extend','forward','word'); var a = s.toString(); s.modify('move','forward','character'); var z=b+a; z= z.trim(); aler(z); //for appear alert that word on click him //now suppose we type here a new variable var variable = "Hellow"; //i need it to move out of that function }); }); var variable2 = variable; alert(variable2); </script> </head> <body> <h3>Hellow world</h3> </body> </html>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)