0
У меня есть текст в моем contenteditable DIV так:Получение текста внутри диапазона шкалы
int main(){
if((x>1) && (x<10))
statement;
}
Его HTML как это:
<div id="board">
<div>int main<span class="openParen bm1">(</span><span class="closeParen bm1">)</span>{</div>
<div>if<span class="openParen bm2">(</span> <span class="openParen bm3">(<span>x>1<span class="closeParen bm3">)</span> && <span class="openParen bm4">(</span>x<10<span class="closeParen bm4">)</span> <span class="closeParen bm2">)</span></div>
<div>statement;</div>
<div>}</div>
</div>
Im на той части, где я обхвата в строка и каждый столбец (в зависимости от количества символов, найденных в этой строке)
for(loop for each row){
for(loop for each character of each
//on the part where the kword_search has found 'if'row
//therefore im on the 2nd row at the 2nd character(disregarding whitespace)
if(/\s+if$/.test(kword_search){
//How will i get the text within bm2, bm3 and bm4?
}
}
}
Как я получит текст в BM2, BM3 и BM4 I хочу открыть текст так, что я могу хранить их в массив, как этот
array[0] = $('.bm2').text(); //((x>1) && (x<10))
array[1] = $('.bm3').text(); //(x>1)
array[2] = $('.bm4').text(); //(x<10)
1. i wud хотел получить идентификатор span оператора cond, если 2. Я хотел бы получить текст этих пролетов – extraRice