Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

126
Views
what to write to add src to image?

I have been trying to add src to the image for a long time, but nothing works for me =( How to create js src for an image? Image tag and class are there, but its src is not?

let child_block = document.querySelector('.child_block');

let xep = document.createElement('img');              
xep.className = 'img_s';
child_block.prepend(xep);
body{
display:grid;
place-items:center;     
user-select:none;
}


.main_block{
display:grid;
place-items:center; 
border:1px solid black;
width: 50%;
height:500px;
margin:50px;

}

.img_s{
width:100%;
border:1px solid red;
}

.child_block{

width:50%;
height:50%;     
}
<div class = "main_block">

<div class = "child_block">


</div>

</div>

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

It should be xep.src = "https://example.com"

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!