Как можно поменять местами элементы ?
Пример исходный код:
[i]Episode 1: Green Arrow (.avi, 445,97 MB)[/i]
[url=http://k2s.cc/file/2f9b36100c73b/Arrow.S04E01.superlo..]Download from Keep2share[/url]
[url=http://publish2.me/file/2f9b36100c73b/Arrow.S04E01.su..]Download from Publish2[/url]
[url=http://tezfiles.com/file/37f4477106196/Arrow.S04E01.s..]Download from TezFiles[/url]
[i]720p: (.mkv, 1,01 GB)[/i]
[quality=720][url=http://k2s.cc/file/0ae81f965a669/Arrow.S04E01.720p.su..]Download from Keep2share[/url]
[url=http://publish2.me/file/0ae81f965a669/Arrow.S04E01.72..]Download from Publish2[/url]
[url=http://tezfiles.com/file/9c05876c2ed52/Arrow.S04E01.7..]Download from TezFiles[/url][/quality]
При нажатии на кнопку Заменить он меняется на:
[i]720p: (.mkv, 1,01 GB)[/i]
[quality=720]
[url=http://k2s.cc/file/0ae81f965a669/Arrow.S04E01.720p.su..]Download from Keep2share[/url] [url=http://publish2.me/file/0ae81f965a669/Arrow.S04E01.72..]Download from Publish2[/url] [url=http://tezfiles.com/file/9c05876c2ed52/Arrow.S04E01.7..]Download from TezFiles[/url]
[/quality]
[i]Episode 1: Green Arrow [/i]
[i](.avi, 445,97 MB)[/i]
[url=http://k2s.cc/file/2f9b36100c73b/Arrow.S04E01.superlo..]Download from Keep2share[/url] [url=http://publish2.me/file/2f9b36100c73b/Arrow.S04E01.su..]Download from Publish2[/url] [url=http://tezfiles.com/file/37f4477106196/Arrow.S04E01.s..]Download from TezFiles[/url]
Тут вроде все работает но нужно вернуть строчку [i]Episode 1: Green Arrow [/i] в начало что бы было так:
[i]Episode 1: Green Arrow [/i]
[i]720p: (.mkv, 1,01 GB)[/i]
[quality=720]
[url=http://k2s.cc/file/0ae81f965a669/Arrow.S04E01.720p.su..]Download from Keep2share[/url] [url=http://publish2.me/file/0ae81f965a669/Arrow.S04E01.72..]Download from Publish2[/url] [url=http://tezfiles.com/file/9c05876c2ed52/Arrow.S04E01.7..]Download from TezFiles[/url]
[/quality]
[i](.avi, 445,97 MB)[/i]
[url=http://k2s.cc/file/2f9b36100c73b/Arrow.S04E01.superlo..]Download from Keep2share[/url] [url=http://publish2.me/file/2f9b36100c73b/Arrow.S04E01.su..]Download from Publish2[/url] [url=http://tezfiles.com/file/37f4477106196/Arrow.S04E01.s..]Download from TezFiles[/url]
Демо:
jsfiddle