Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript match image attribute value

var str = "<img alt='' src='http://api.com/images/UID' /><br/>Some plain text<br/><a href='http://www.google.com'>http://www.google.com</a>";

var regex = /<img.*?src='(.*?)'/;
var src = regex.exec(str)[1];

console.log(src);
Comment

javascript match image attribute value

var str = "<img alt='' src='http://api.com/images/UID' /><br/>Some plain text<br/><a href='http://www.google.com'>http://www.google.com</a>";

var regex = /<img.*?src='(.*?)'/;
var src = regex.exec(str)[1];

console.log(src);
Comment

PREVIOUS NEXT
Code Example
Javascript :: how to display data from json api using flutter expansiontile 
Javascript :: Uncaught ReferenceError: jQuery is not defined at (index): "405" 
Javascript :: rangeSlider format price js 
Javascript :: is typescript slower than javascript 
Javascript :: es6 1 to one 
Javascript :: show ingoing node on click cytoscape.js 
Javascript :: send get request with button to endpoint 
Javascript :: if typeof equals array javascript 
Javascript :: javascript lookahead 
Javascript :: puzzle interview questions javascript 
Javascript :: is nodejs code visible client side 
Javascript :: js nvl function 
Javascript :: print("Google") in JavaScript 
Javascript :: dustjs compilator 
Javascript :: faher js 
Javascript :: react native navigation paramlist never used 
Javascript :: extend static class javascript 
Javascript :: svlete each index 
Javascript :: js event problem solving 
Javascript :: Back button directive Angular 
Javascript :: elte html if not updating 
Javascript :: set popper click outside 
Javascript :: setstate before function react 
Javascript :: Start and Daemonize any application nodejs 
Javascript :: 4.6.3. Order of Operations¶ 
Javascript :: dispatch on unmount 
Javascript :: js string get substring between two characters 
Javascript :: javascript substtgin 
Javascript :: what in the world 
Javascript :: how to log message with replacing placeholders in the string in js 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =