I am trying to change a tag of a html element.
HTML
<div id='content'>
<g transform="100">.....</g>
<g transform="150">This needs to stay as is</g>
</div>
How do I change the transform value of the first element? I have the following so far…
$('#content g:first').replaceWith( "hello" );
Obviously this changes everything from the to the end where I only need to change the transform value.
You can use
attrmethod:However if your document type is HTML
gis not a valid tag, andtransformis not a valid attribute, you can usedata-*attributes instead.