Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery get image src

$('.img1 img').attr('src');
Comment

Changing the img src using jQuery.

//Change the img property using jQuery's attr method
$("#myImage").attr("src", 'img/new-image.jpg');
Comment

jquery get image src

$('#imageContainerId').prop('src')
Comment

jquery get img src

$('img').attr(src);
Comment

jquery get image src

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);
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: looping through an array javascript sum 
Javascript :: else if javascript 
Javascript :: js debouncing 
Javascript :: jquery preload images 
Javascript :: jquery chrome extension 
Javascript :: insert element in specific index javascript 
Javascript :: convert an object to an array 
Javascript :: discord.js get the message before 
Javascript :: make a flat object from object of object list 
Javascript :: Getting Error 404 while running npm install create-react-app 
Javascript :: join in mongodb 
Javascript :: angular loop through key values in map 
Javascript :: onsubmit in reactjs 
Javascript :: anagram program in javascript 
Javascript :: select a particular sibling jquey 
Javascript :: vue js tutorial 
Javascript :: input two decimal places javascript 
Javascript :: express send code 
Javascript :: js reverse int in descending order 
Javascript :: Use parseInt() in the convertToInteger function so it converts a binary number to an integer and returns it. 
Javascript :: how to know if select input has been selected in js 
Javascript :: Limit text to specified number of words using Javascript 
Javascript :: react detect autofill 
Javascript :: regex for a, e, i , o , u 
Javascript :: how to count react renders 
Javascript :: vue custom events 
Javascript :: nextjs getserversideprops 
Javascript :: do some css using js on selector 
Javascript :: document.queryselector null check 
Javascript :: click on button submitting the form in angular 
ADD CONTENT
Topic
Content
Source link
Name
4+2 =