Let $A$ be a commutative ring and $S$ a multiplicative closed subset of $A$. If $A$ is a PID, show that $S^{-1}A$ is a PID.
I've taken an ideal $I$ of $S^{-1}A$ and I've tried to see that is generated by one element; the ideal $I$ has the form $S^{-1}J$ with $J$ an ideal of $A$. $J$ is generated by one element but I can't see why $I$ has to be generated by one element, maybe I'm wrong.
An arbitrary element $x$ of $S^{-1}J$ is of the form $$ x=\sum_is_i^{-1}j_i $$ with $s_i\in S, j_i\in J$ for all $i$. If $j$ is a generator of $J$ as an ideal, then $j_i=a_ij$ for some $a_i\in A$. Can you now write $x$ in the form $x=x'j$ for some $x'\in S^{-1}A$?