how to remove text style on td in angularjs


var colorSpan = element(by.css('span'));

it('should check ng-style', function() {
expect(colorSpan.getCssValue('color')).toMatch(/rgba(0, 0, 0, 1)|rgb(0, 0, 0)/);
element(by.css('input[value='set color']')).click();
expect(colorSpan.getCssValue('color')).toMatch(/rgba(255, 0, 0, 1)|rgb(255, 0, 0)/);
element(by.css('input[value=clear]')).click();
expect(colorSpan.getCssValue('color')).toMatch(/rgba(0, 0, 0, 1)|rgb(0, 0, 0)/);
});

span {
color: black;
}

<input type="button" value="set color" ng-click="myStyle={color:'red'}">
<input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>

www.codegrepper.com
www.stackoverflow.com

How to remove options from selectlist in javascript?


var selectobject = document.getElementById("mySelect");
for (var i=0; i<selectobject.length; i++) {
if (selectobject.options[i].value == 'A')
selectobject.remove(i);
}

<select id="mySelect" name="val" size="1" >
<option value="A">Apple</option>
<option value="C">Cars</option>
<option value="H">Honda</option>
<option value="F">Fiat</option>
<option value="I">Indigo</option>
</select>

www.codegrepper.com
www.stackoverflow.com