document.querySelector with AppleScript / Safari I need a script to open each tab in safari when I get "valueIneed" from an internal website 

here is the HTML tag 

&lt;td class="orderDetails"&gt;


    &lt;p class="details"&gt;
        (My Certificate)
    &lt;/p&gt;


here is what I tried this but this is failing 

tell application "Safari"
    do JavaScript "
        var forgiveStatus = document.querySelector('class[details\"(My Certificate).innerHTML;
        " in current tab of first window
    set checkvalue to (do JavaScript "theStatus;" in current tab of first window) as string
end tell


for more information it's could have multiple instance of the same tag, and I need to open each one in a new tab, or even better click on them one after one
You haven't closed any quotes or brackets. You need the following four characters.

var theStatus = document.querySelector('class[details="(valueIneed)"]')
                                                                   ^^^^


This is now syntactically correct JavaScript. I still doubt it'll do what you need, but without seeing the DOM of the page you're running this on and a full problem description I can't say for sure.

Given the update to your question with a snippet of HTML, the code you're trying won't work. To get the inner HTML of the element, use the following JavaScript:

document.querySelector("td.orderDetails .details").innerHTML;