Skip to content

Instantly share code, notes, and snippets.

@dacur dacur/getValue.js
Created Oct 9, 2014

What would you like to do?
Get the value of a Div (from a row of Divs that were clicked) that was dynamically created. See notes in code below.
$('.catRow').on('click', function(){
var catEditing = $(this).html(); //All divs in row
var catName = $(catEditing).closest('.catName').text();
For example, you are dynamically creating rows of data that are given from the DB.
Each row is clickable.
To find the Name (catName; i.e. 'category name') of the clicked row, use this code!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.