Q:

jquery get image src

$('.img1 img').attr('src');
1
$('img').attr(src);
0
readTextFile("file:///C:/your/path/to/file.txt");

function readTextFile(file)
{
    var rawFile = new XMLHttpRequest();
    rawFile.open("GET", file, false);
    rawFile.onreadystatechange = function ()
    {
        if(rawFile.readyState === 4)
        {
            if(rawFile.status === 200 || rawFile.status == 0)
            {
                var allText = rawFile.responseText;
                alert(allText);
            }
        }
    }
    rawFile.send(null);
}
-1

 var str = "Hello World!";
var res = str.toUpperCase();
 
1
$("p").click();

$("p").click(function(){

  // action goes here!!

});

 
0

New to Communities?

Join the community