.class is not a function
I'm trying to change the content of a div (no ID, but it does have a class) contained within another div (has ID and class). I'm getting two errors - "class is not a function" and "html is not a function".
This is utilizing the jQuery 1.7.2 library.
Here is the code I'm trying to write:
<div class="classA" id="ID_#cf variable#">// There are several rows, each with unique IDs that begin with "ID_" //
<div class="classB"> content 1</div>
<div class="classC"> content 2</div>
<div class="classD"> content 3</div>
What am I missing?
var targetID = $('.rowFocus').attr('id);
targetID = document.getElementById(targetID);
var stuff = targetID.class('.classD').html();
Damn.. I spent a lot of time playing with this before posting my question. Suddenly, after posting it, I have resolved it. (sigh)
var newVar = "A string of new text";
var targetID = $('.rowFocus');
var childs = targetID.children('classD');
Im a little confused by your explanation, where does .rowfocus come into play?
Im guessing somehting like this?
var stuff = targetID.find('.classD').html();
rowFocus is a highlighted row that contains order status, customer, website (when clicked, it highlights and grabs data from the database to display in an editable form.)
I was trying to set it so that when one field in the form was changed (website), it would automatically update the database AND change the website in the list. It's working. :)