For SEO purposes, some experiments have been conducted that show that at least large players (like Google) can follow and execute some simple JavaScript. They avoid covert redirects, etc., but some basic manipulations with the content seem to go through. (I don’t have a link convenient for Google itself either confirming or denying it, these are just different messages that I encountered when doing this before.)
However, this is usually considered unreliable. If SEO is done for any important purpose, don't rely on spiders indexing a lot of dynamic content.
Actually a very good (in my opinion, one way or another) answer to a very similar question here. What I like about this answer is how it breaks down the steps to create good, indexable, and the best of all supported web pages with proper separation of problems. Adhering to as much of this process as possible will result in good SEO, good accessibility, and good design skills in general.
David
source share