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

220
Views
How to retrieve an Id from the console.log(ui)

I have a jquery where I did a console.log(ui). When I inspected my browser I got an object in the attached image

        stop: function (event, ui) {
            
            console.log(ui);
          
        }

I want to be able to retrieve that number after div# highlighted in yellow in the image. How can I retrieve just that number and pass to a javascript method?enter image description here

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

0

Ok here you go. If you get html from console.log(ui.helper[0]) you can retrieve easily.

Example:

var str = '<div class="draggable position-absolute ui-draggable obstacle" id="9" style="left: 441.25px; top: 179.25px;">'; // get from ui.helper[0]
var raw = $(str);
var result = raw.attr("id");
console.log(result);
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

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!