JavaScript JQuery selector returns undefined jquery selector returns array,jquery selector returns undefined,jquery selector

This html code was generated of my php code, but I copied this out of the HTML code of the browser.

The console.log prints out undefined. I don't know why. It's probably a really dumb mistake, like always. Thank you for your help.

$('.show').click(function() {
  var id = $(this).attr('id');
  var div = $("div#" + id);
  console.log(div.html());
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<h3>Heading <a target='_blank' href='#' class='show' id='2962'>+</a></h3>
<div class='.slidetoggle' id='2962' style='display: none;'>
  <p>Test!</p>
</div>
Answer:1

Using vue.js 2, inside a for loop, I need to render a row only if the current iterated item passes some test. The test is complex so a simple v-if="item.value == x" wont do. I've written a ...

Using vue.js 2, inside a for loop, I need to render a row only if the current iterated item passes some test. The test is complex so a simple v-if="item.value == x" wont do. I've written a ...

  1. call function inside function python
  2. call function inside function
  3. call function inside class python
  4. call function inside function javascript
  5. call function inside for loop javascript
  6. call function inside another function python
  7. call function inside class javascript
  8. call function inside useeffect
  9. call function inside react component
  10. call function inside iframe
  11. call function inside object javascript
  12. call function inside function c++
  13. call function inside class c++
  14. call function inside string javascript
  15. call function inside function powershell
  16. call function inside html
  17. call function inside module.exports
  18. call function inside lambda python
  19. call function inside bash script
  20. call function inside promise

why do we need self referential object in javascript. example let a = {}; a.self = a; now a property self is referring to itself and become circular object. in nodejs when we use routing library ...

why do we need self referential object in javascript. example let a = {}; a.self = a; now a property self is referring to itself and become circular object. in nodejs when we use routing library ...

Using a Array.splice is fine as long as it's a single value. Suppose I have an array with 10 elements and I want to remove element 2,4 and 8, using Array.splice(index,1) in a for loop is a bad idea ...

Using a Array.splice is fine as long as it's a single value. Suppose I have an array with 10 elements and I want to remove element 2,4 and 8, using Array.splice(index,1) in a for loop is a bad idea ...

  1. remove multiple elements from list python
  2. remove multiple elements from array javascript
  3. remove multiple elements from set python
  4. remove multiple elements from list python by index
  5. remove multiple elements from vector c++
  6. remove multiple elements from array swift
  7. remove multiple elements from arraylist java
  8. remove multiple elements from an array
  9. remove multiple elements jquery
  10. remove multiple elements from dictionary python
  11. remove multiple elements from dom javascript
  12. remove multiple elements from array matlab
  13. remove multiple elements from list python using index
  14. remove multiple elements from list r
  15. remove multiple elements from numpy array python
  16. remove multiple elements from list java
  17. remove multiple elements from list c#
  18. remove multiple elements from array php
  19. remove multiple elements from string python
  20. remove multiple elements from array typescript

I have a simple AJAX GET request going to a certain PHP page: $.ajax({ type: "GET", url: "http://example.com/remote.php", success: function(response){ document.getElementById("...

I have a simple AJAX GET request going to a certain PHP page: $.ajax({ type: "GET", url: "http://example.com/remote.php", success: function(response){ document.getElementById("...

  1. from what page to start
  2. php from which page
  3. php check from which page
  4. contact form 7 from which page