I have a script that populates that hides and shows divs based on whether or not it contains a portion of an Id, then shows the div that contains the full, unique Id passed to the function. The function is as follows:
function showPlot(plotId) {
// Hide all plots by switching them to a class
$('div[id^="plot_"').hide(); //<--Won't hide the divs matching that portion of the Id
// Show the selected plot by changing it's class
$('#' + plotId).show('fast');
}
The problem is the .hide() function won’t hide the specified divs as expected. I might not have the syntax right, but I’m pretty sure it’s correct according to the API. Is there something else I’m missing? Help is appreciated.
You’re missing the closing
].